|
|
|
date: Tue, 1 Jul 2008 07:05:01 -0700,
group: microsoft.public.windowsmedia.sdk
back
Re: 0x8007000E on AllocateSample() ?
After some research. It seems that there is an intermittent memory leak in
the transcode process. I brought the code over from Visual C++ 6 to VS2005,
recompiled and we started seeing this problem. Logically nothing changed in
the transcode process, and it now makes sense as to why there was no memory
available (virtual mem was at 2GB). The same process on multiple different
identical machines are not having this issue, yet it is not isolated to this
machine.
I am doing this which has worked for about 3 years with no problems:
hr = m_pWriter->AllocateSample(SampleLen, &pBuffer);
hr = pBuffer->GetBuffer(&lpOutputBuffer);
CopyMemory(lpOutputBuffer, SampleData, SampleLen);
hr = pBuffer->SetLength(SampleLen);
hr = m_pWriter->WriteSample(m_dwAudioInput, SampleTime, dwFlags, pBuffer);
"Alessandro Angeli" wrote:
> From: "tmugavero"
>
> > Any idea what would cause this? The process says it is
> > hardly using any memory and this is the first time I've
> > seen the error with this process in 2 years. I'm using
> > Windows Media Format SDK 11 on Windows XP boxes, compiled
> > in Visual Studio 2005 on the same setup. Any ideas would
> > be greatly appreciated.
>
> When and where are you calling AllocateSample()?
>
>
> --
> // Alessandro Angeli
> // MVP :: DirectShow / MediaFoundation
> // mvpnews at riseoftheants dot com
> // http://www.riseoftheants.com/mmx/faq.htm
>
>
>
date: Tue, 1 Jul 2008 08:14:01 -0700
author: tmugavero
Re: 0x8007000E on AllocateSample() ?
Ok I've tracked down this issue. Basically, transcoding 3 - 480x360 streams
live simultaneously will start dumping data to virtual memory. (2 streams
work fine) Virtual memory will continue to rise without being released until
total memory runs out and the streams die. Not sure if there is a way to
flush the virtual memory or if that would even be wise considering it
probably holds video and audio samples, but ultimately it comes down to a
hardware issue at this point, ie. it cant keep up. I don't know if I can
improve the behavior programatically, but will update here if I can.
Thanks!
"tmugavero" wrote:
> Sorry, missed that part...Yes I'm doing that. It's actually a SAFE_RELEASE
>
> #define SAFE_RELEASE(x) \
> if ((x) != NULL){ \
> (x)->Release(); \
> (x) = NULL; \
> }
>
>
>
> "Alessandro Angeli" wrote:
>
> > From: "tmugavero"
> >
> > > hr = m_pWriter->AllocateSample(SampleLen, &pBuffer);
> > > hr = pBuffer->GetBuffer(&lpOutputBuffer);
> > > CopyMemory(lpOutputBuffer, SampleData, SampleLen);
> > > hr = pBuffer->SetLength(SampleLen);
> > > hr = m_pWriter->WriteSample(m_dwAudioInput, SampleTime,
> > > dwFlags, pBuffer);
> >
> > Aren't you missing a pBuffer->Release() here?
> >
> > --
> > // Alessandro Angeli
> > // MVP :: DirectShow / MediaFoundation
> > // mvpnews at riseoftheants dot com
> > // http://www.riseoftheants.com/mmx/faq.htm
> >
> >
> >
date: Mon, 7 Jul 2008 06:53:06 -0700
author: tmugavero
|
|