[FFmpeg-trac] #6533(avformat:reopened): Invalid EXT-X-TARGETDURATION in HLS
FFmpeg
trac at avcodec.org
Thu Aug 10 13:24:11 EEST 2017
#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:
>
> {{{
> 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).
Hi tonn81,
I will modify the val, from 0.001 to 0.000001, that is 1
microsecound, transform to frames per second is 999999fps.
(Meet your wishes)
--
Ticket URL: <https://trac.ffmpeg.org/ticket/6533#comment:16>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list