[FFmpeg-devel] [PATCH] mkv MatroskaBlock.duration not initialized for SimpleBlock

John Stebbins stebbins at jetheaddev.com
Sat Mar 19 20:57:24 CET 2011


On 03/18/2011 03:29 AM, Aurelien Jacobs wrote:
> On Thu, Mar 17, 2011 at 08:14:35PM -0700, John Stebbins wrote:
>> On 03/16/2011 03:54 PM, Aurelien Jacobs wrote:
>>> On Wed, Mar 09, 2011 at 06:52:26PM -0800, John Stebbins wrote:
>>>> When a normal Block is parsed, duration is initialized to
>>>> AV_NOPTS_VALUE.  If it is not changed, then the track's default
>>>> duration is used.  But for SimpleBlock, duration is initialized to 0
>>>> instead of AV_NOPTS_VALUE.  This is due to the difference in how
>>>> EBML_NEST vs EBML_PASS are processed.  Setting duration to 0 leads
>>>> eventually to estimating the frame duration in util.c.
>>> Indeed. Thanks for the good analysis.
>>> I've just fixed it in a slightly nicer way.
>>>
>>>>   For the
>>>> sample I am testing (DTS-HD MA track in mkv generated by MakeMKV),
>>>> this estimate is based on frame size and bitrate which is wildly
>>>> inaccurate. End result is pts values that jump all over the place
>>>> and sometimes go backwards.
>>> Could you please check if my fix works fine for your sample ?
>> I should have time to test the latest code tomorrow.  Did your patch
>> make it to a mailing list somewhere?  I can't find it in all the
>> confusion with the splits and all.  I would like to look it over to
>> see how you solved the problem.
> Have a look here:
> http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=6f1260f87061bdf7a8ff2472e309d9635e5d770d
>
I've tested this on the sample I had issues with and it does indeed solve the problem.

Thanks




More information about the ffmpeg-devel mailing list