[FFmpeg-devel] [PATCH] H.264 timestamps in h264_parser - complete set

Michael Niedermayer michaelni
Thu Feb 19 19:02:47 CET 2009


On Thu, Feb 19, 2009 at 06:23:41PM +0100, Ivan Schreter wrote:
> Michael Niedermayer wrote:
>> On Thu, Feb 19, 2009 at 11:10:39AM +0100, Ivan Schreter wrote:
>>   
>>>      int key_frame;
>>> +    /*!
>>>     
>>
>> a empty line between these 2 would improve readability
>>   
> Added.
>
>>> +     * Set by parser to number of frames until output synchronizes.
>>> +     * Initialized to 0.
>>> +     * Some codecs (e.g., H.264) may associate convergence duration with
>>> +     * a key frame. The output of the decoder after this many frames
>>> +     * after key frame will match output as if decoded from first frame.
>>> +     */
>>> +    int convergence_duration;
>>>  } AVCodecParserContext;
>>>      
>>
>> i would prefer if convergence_duration in AVCodecParserContext where
>> defined the same way as in AVPacket, its a source of confusion otherwise
>>
>>   
> I copied the docs from AVPacket changing timestamp to frame count. Namely, 
> it can't be quite the same, the codec doesn't necessarily have to know the 
> duration of one frame. So it can't be timestamp, only frame count.

there is no reason why a codec couldnt store the timestamp and not the
frame count


>
> I also changed it to use AV_NOPTS_VALUE for undefined.

good


[...]
> Index: libavformat/utils.c
> ===================================================================
> --- libavformat/utils.c	(revision 17452)
> +++ libavformat/utils.c	(working copy)
> @@ -909,6 +909,17 @@
>          else if (pc->key_frame == -1 && pc->pict_type == FF_I_TYPE)
>              pkt->flags |= PKT_FLAG_KEY;
>      }
> +    pkt->convergence_duration = AV_NOPTS_VALUE;
> +    if (pc) {

shouldnt this be inside the if() ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090219/3562fc02/attachment.pgp>



More information about the ffmpeg-devel mailing list