#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 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 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 that X.001 it is ceiling:

 {{{
 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:14>
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