[FFmpeg-devel] [PATCH] Fix broken vbv_buffer_init handling in libx264.c

Jason Garrett-Glaser jason
Wed Feb 9 01:00:24 CET 2011


On Mon, Feb 7, 2011 at 2:27 AM, Jason Garrett-Glaser <jason at x264.com> wrote:
> On Mon, Feb 7, 2011 at 2:22 AM, Baptiste Coudurier
> <baptiste.coudurier at gmail.com> wrote:
>> On 2/7/11 2:18 AM, Jason Garrett-Glaser wrote:
>>> On Mon, Feb 7, 2011 at 1:42 AM, Baptiste Coudurier
>>> <baptiste.coudurier at gmail.com> wrote:
>>>> On 2/6/11 5:11 AM, Jason Garrett-Glaser wrote:
>>>>> Due to being pants-on-head retarded, libavcodec defaults this to zero, which
>>>>> results in broken output.
>>>>
>>>> x264_encoder_open should fail instead of silently generating a broken
>>>> output.
>>>
>>> What values should it fail for? ?0 is clearly bad, but what about
>>> 0.001? ?Where do you place the cutoff?
>>
>> You're the one knowing when the code breaks. Check when it fails and
>> return an error.
>
> Impossible. ?"Insufficient VBV buffer for the first frame" can't be
> known until the frame has been encoded and underflows the buffer.
>
> Jason
>

I've applied this fix to libx264.c for the time being.  We can try to
get a better fix in the future, to libavcodec, libx264, or both.

Jason



More information about the ffmpeg-devel mailing list