• Anton Khirnov's avatar
    fftools/ffmpeg: rework keeping track of file duration for -stream_loop · 889a022c
    Anton Khirnov authored
    Current code tracks min/max pts for each stream separately; then when
    the file ends it combines them with last frame's duration to compute the
    total duration of each stream; finally it selects the longest of those
    durations as the file duration.
    
    This is incorrect - the total file duration is the largest timestamp
    difference between any frames, regardless of the stream.
    
    Also change the way the last frame information is reported from decoders
    to the muxer - previously it would be just the last frame's duration,
    now the end timestamp is sent, which is simpler.
    
    Changes the result of the fate-ffmpeg-streamloop-transcode-av test,
    where the timestamps are shifted slightly forward. Note that the
    matroska demuxer does not return the first audio packet after seeking
    (due to buggy interaction betwen the generic code and the demuxer), so
    there is a gap in audio.
    889a022c
ffmpeg_utils.h 1.58 KB