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

Ivan Schreter schreter
Thu Feb 19 18:23:41 CET 2009


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.

I also changed it to use AV_NOPTS_VALUE for undefined.

> [...]
>   
>> +        } else if (pc->key_frame == -1 && pc->pict_type == FF_I_TYPE) {
>>              pkt->flags |= PKT_FLAG_KEY;
>> +            pkt->convergence_duration = 0;
>> +        }
>>     
>
> i dont see why convergence_duration should be tied to key_frame being
> not -1
>   
OK, changed.

New patch attached.

Regards,

Ivan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: avcodec_convdur.patch
Type: text/x-patch
Size: 3163 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090219/3c00130a/attachment.bin>



More information about the ffmpeg-devel mailing list