[MPlayer-dev-eng] Re: PATCH [2/12] CoreAVC Decoder Support

Alan Nisota alannisota at gmail.com
Sat Feb 10 18:55:04 CET 2007


Vladimir Voroshilov <voroshil <at> gmail.com> writes:

> 
> Hi, Alan
> Another 2 cents.
> 
> 2007/2/10, Alan Nisota <alannisota <at> gmail.com>:
> > EnumMediaTypes->Next allocating an AM_MEDIA_TYPE structure, which I'm not 
sure
> > how to free.  To free it, you need to call the windows DeleteMediaType 
(which
> To free AM_MEDIA_TYPE structure you can use something like this (pmt
> is pointer to AM_MEDIA_TYPE):
> if(pmt){
>     if(pmt->pbFormat && pmt->cbFormat>0) free(pmt->pbFormat);
>     free(pmt);
> }

Yes, this is trivial, but it is only true if we allocate it with malloc.  In 
windows, it is allocated via CoTaskMemAlloc (or CreateMediaType), and you can't 
use 'free' on that.  The problem is that I don't know how to call win32 API 
functions inside DS_Filter and have them work with win32.c and native.  It may 
be easy to do, so if someone could give me an example, I could implement it 
properly.  Again, I'm not sure it is really worth the effort though.






More information about the MPlayer-dev-eng mailing list