[FFmpeg-devel] [PATCH][7/8] Add VA API accelerated H.264 decoding (take 4)

Gwenole Beauchesne gbeauchesne
Fri Feb 13 06:41:03 CET 2009


Le 13 f?vr. 09 ? 01:59, Michael Niedermayer a ?crit :

>> e.g. a means to initialize display-independent (and player-
>> independent, implementation-wise) accelerators and cleanly
>> deinitialize accelerator (lazy-allocated) data. Haven't you noticed
>> that the current VDPAU implementation is memleaking bitstream  
>> buffers?
>
> had i noticed, i of course would not have approved the patch ...
[...]
> Besides, would the decoder output decoded surfaces it wouldnt output
> the bitstream ...

Well, actually, it's not the full bitstreams that are leaked  
(fortunately!) but "only" structs holding pointers to the bitstream.  
That's fewer bytes, but a leak anyway. Probably have them released  
after the ff_draw_horiz_band() call but I think the initial intent was  
to avoid memory re-allocations wherever possible.

>> I think if FFmpeg allocated data it should release it itself somehow
>> when it's not longer needed, users of the lib will generally forget
>> about it otherwise.
>
> maybe it could be freed through AVCodecContext.release_buffer()

But ::release_buffer() would be from user-provided code though the  
data was allocated from within FFmpeg. Of course, another solution  
would be to not do any sort of lazy data allocation as you seem to  
suggest.



More information about the ffmpeg-devel mailing list