[FFmpeg-trac] #11188(tools:new): ffmpeg_opt.c correct_input_start_times(void) calculates wrong ts_offset
FFmpeg
trac at avcodec.org
Fri Sep 13 16:19:21 EEST 2024
#11188: ffmpeg_opt.c correct_input_start_times(void) calculates wrong ts_offset
-------------------------------------+----------------------------------
Reporter: Jens Viebig | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: tools
Version: git-master | Resolution:
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+----------------------------------
Comment (by Jens Viebig):
This is much more clear to read:
abs_start_seek = is->start_time + ((ifile->start_time != AV_NOPTS_VALUE) ?
ifile->start_time : 0);
if we remove the parenthesis like this:
abs_start_seek = is->start_time + (ifile->start_time != AV_NOPTS_VALUE ?
ifile->start_time : 0);
is it guaranteed to evaluate "ifile->start_time != AV_NOPTS_VALUE" before
the shorthand if ?
Or is there a risk that it will be evaluated as "AV_NOPTS_VALUE ?
ifile->start_time : 0" ?
We think with both parenthesis in place is the most safe and readable
option
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11188#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list