diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-11-13 22:55:34 +0100 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-11-13 22:57:02 +0100 |
commit | 8fad4b4e251bb21f8871fa829b593454528aff24 (patch) | |
tree | bda5790e6959ca5d64963800e06c4fb2de6accb3 /libavformat/movenc.c | |
parent | fb40daa7f3b86b66b15973d33f4269461b1e1ffd (diff) | |
parent | 785c25443b56adb6dbbb78d68cccbd9bd4a42e05 (diff) | |
download | ffmpeg-8fad4b4e251bb21f8871fa829b593454528aff24.tar.gz |
Merge commit '785c25443b56adb6dbbb78d68cccbd9bd4a42e05'
* commit '785c25443b56adb6dbbb78d68cccbd9bd4a42e05':
movenc: Apply offsets on timestamps when peeking into interleaving queues
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index efa050ee44..7a726c6bfd 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4484,15 +4484,13 @@ static int mov_flush_fragment(AVFormatContext *s, int force) for (i = 0; i < s->nb_streams; i++) { MOVTrack *track = &mov->tracks[i]; if (!track->end_reliable) { - int64_t ts_offset; - const AVPacket *next = ff_interleaved_peek(s, i, &ts_offset); - if (next) { - track->track_duration = next->dts - track->start_dts + ts_offset; - if (next->pts != AV_NOPTS_VALUE) - track->end_pts = next->pts; + AVPacket pkt; + if (!ff_interleaved_peek(s, i, &pkt, 1)) { + track->track_duration = pkt.dts - track->start_dts; + if (pkt.pts != AV_NOPTS_VALUE) + track->end_pts = pkt.pts; else - track->end_pts = next->dts; - track->end_pts += ts_offset; + track->end_pts = pkt.dts; } } } |