[vlc-devel] [vlc-commits] packetizer: h264: set duration also using frame rate

Filip Roséen filip at atch.se
Wed Mar 22 18:06:15 CET 2017


Hi Francois,

On 2017-03-22 15:13, Francois Cartegnie wrote:

> Le 22/03/2017 à 14:32, Filip Roséen a écrit :
> 
> >> +    if( p_pic->i_length == 0 )
> >> +    {
> >> +        if( p_sps->vui.i_time_scale )
> >> +        {
> >> +            p_pic->i_length = CLOCK_FREQ * i_num_clock_ts *
> >> +                              p_sps->vui.i_num_units_in_tick / p_sps->vui.i_time_scale;
> > 
> > I cannot see how the above is valid if `p_sps->vui.b_fixed_frame_rate
> > == 0`, as such I propose the attached patch as a fixup. I would
> > however be happy to stand corrected as learning something new is
> > always welcomed.
> 
> b_fixed_frame_rate and time_scale presences are not exclusive.

I was aware of that, and I guess the relevant calculation is
equivalent of querying the maximum possible-frame rate (ie. the
minimal duration the p_pic will have) in that case - would that be
correct?

Thanks for your answer, the more knowledge gained - the better!

> i_num_clock_ts is timing and is valid, fixed rate or not.
> The only issue here is time_scale not matching demuxer's values/dts.

As my curiousity is pretty much always present, please feel free to
only reply to questions such as this when you have time to spare (that
of course applies to others reading this thread as well).

There is absolutely no rush.

Best Regards,\
Filip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170322/a81142e6/attachment.html>


More information about the vlc-devel mailing list