diff options
author | Martin Storsjö <martin@martin.st> | 2016-06-24 23:38:54 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2016-06-28 14:16:06 +0300 |
commit | 785c25443b56adb6dbbb78d68cccbd9bd4a42e05 (patch) | |
tree | 91dc6842332b80b09e902ce212c4c608500f3eb7 /libavformat/movenc.c | |
parent | eccfb9778ae939764d17457f34338d140832d9e1 (diff) |
movenc: Apply offsets on timestamps when peeking into interleaving queues
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index aadfa06a5a..393442cf5b 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -3262,13 +3262,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) { - const AVPacket *next = ff_interleaved_peek(s, i); - if (next) { - track->track_duration = next->dts - track->start_dts; - 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 = pkt.dts; } } } |