Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
media
danimation.controls
danimation.programming
devices
drm
dshow.programming
dtransform
encoder
encoder.optimization
hometheaterpc
media
media.beta
media.beta.encoder
mediacenter
mediacenter.portable
mediaplayer
music.products
musicproducer
player
player.plugins
player.skins
player.solaris
player.visualizations
player.web
sdk
server
tools
  
 
date: Tue, 1 Jul 2008 07:05:01 -0700,    group: microsoft.public.windowsmedia.sdk        back       


0x8007000E on AllocateSample() ?   
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. 

Thanks
date: Tue, 1 Jul 2008 07:05:01 -0700   author:   tmugavero

Re: 0x8007000E on AllocateSample() ?   
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 10:32:31 -0400   author:   Alessandro Angeli

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() ?   
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: Tue, 1 Jul 2008 11:35:04 -0400   author:   Alessandro Angeli

Re: 0x8007000E on AllocateSample() ?   
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: Tue, 1 Jul 2008 09:12:03 -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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us