#6533: Invalid EXT-X-TARGETDURATION in HLS
-------------------------------------+------------------------------------
             Reporter:  tonn81       |                    Owner:
                 Type:  defect       |                   Status:  reopened
             Priority:  normal       |                Component:  avformat
              Version:  unspecified  |               Resolution:
             Keywords:  hls          |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+------------------------------------

Comment (by stevenliu):

 Replying to [comment:14 tonn81]:
 > Replying to [comment:13 stevenliu]:
 > > That is not ceil:
 > > {{{
 > > static int get_int_from_double(double val)
 > > {
 > >     return (int)((val - (int)val) >= 0.001) ? (int)(val + 1) :
 (int)val;
 > > }
 > > }}}
 >
 > If you check the code, it is ceiling when float part of value is bigger
 than `0.001`.
 >
 > If you run it:
 >
 > {{{
 >
 > get_int_from_double(4.000) # 4
 > get_int_from_double(4.001) # 4
 > get_int_from_double(4.002) # 5
 > get_int_from_double(4.003) # 5
 > get_int_from_double(4.02) # 5
 >
 > }}}
 >
 > For anything bigger than X.001 it is ceiling:
 0.001 = 1ms
 if the frame duration is LESS or EQU than 1ms, maybe the fps = 999? can
 you reproduce the bug on your compute? if you can, i can modify the val
 from 0.001 to 0.000001.
 >
 > {{{
 > 4.0 => 4
 > 4.1 => 5
 > 4.2 => 5
 > 4.3 => 5
 > 4.4 => 5
 > 4.5 => 5
 > 4.6 => 5
 > 4.7 => 5
 > 4.8 => 5
 > 4.9 => 5
 > 5.0 => 5
 > 2.1 => 3
 > }}}
 >
 > > or can you reproduce the bug of the EXT_X_TARGETDURATION *LESS* than
 en->duration ?
 >
 > Since `get_int_from_double` is making ceiling the most of the time,
 `EXT_X_TARGETDURATION` would be always bigger than en->duration
 >
 > I propose one-line change that gives better result (more precise and the
 one expected by user).

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6533#comment:15>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
_______________________________________________
FFmpeg-trac mailing list
FFmpeg-trac@avcodec.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-trac

Reply via email to