[FFmpeg-devel] [PATCH] Add get_audio_buffer_ref function to lavfi.

S.N. Hemanth Meenakshisundaram smeenaks
Thu Sep 16 07:53:00 CEST 2010


 On 09/15/2010 11:01 AM, Michael Niedermayer wrote:
> On Wed, Sep 15, 2010 at 09:10:45AM -0700, S.N. Hemanth Meenakshisundaram wrote:
>>  On 09/15/2010 05:02 AM, Michael Niedermayer wrote:
>>> On Thu, Sep 02, 2010 at 12:52:54AM -0700, S.N. Hemanth Meenakshisundaram wrote:
>>> [...]
>
> link is unused

Link is unused in both get_audio_buffer and get_audio_buffer_ref.
However removing it would make it inconsistent with get_video_buffer. Is
this ok?

> doxy (in header) missing

Fixed.

> and iam unusre if it should free buf on failure or leave that to the caller

Fixed. Caller frees buf.


However there is one problem. Currently the unref_buffer call frees the
buffer when the last reference is removed. There are two ways I see
around this:

1. Increasing the refcount by 1 when get_audio_buffer_ref is called
directly.

2. Adding a flag to indicate if buffer must be freed by caller and
checking this flag in unref_buffer

I guess the 2nd is preferable. Comments?

Regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-get_audio_buffer_ref-to-lavfi-audio-framework.patch
Type: text/x-patch
Size: 7128 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100915/5c0586fa/attachment.bin>



More information about the ffmpeg-devel mailing list