diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-06-25 02:54:43 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-06-25 03:04:55 +0200 |
commit | 46a60fe184cfd39cc9517c860c7404d60977456d (patch) | |
tree | defea2eafea18157f2ea1c217765c749524720f0 /libavformat/movenc.c | |
parent | f573acc4244769c294d45df9e7dc47d9d8cfb8b7 (diff) |
avformat: Fix ff_interleaved_peek()
Fixes assertion failures in movenc
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index bf57174850..693851e153 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4314,13 +4314,15 @@ 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); + int64_t ts_offset; + const AVPacket *next = ff_interleaved_peek(s, i, &ts_offset); if (next) { - track->track_duration = next->dts - track->start_dts; + track->track_duration = next->dts - track->start_dts + ts_offset; if (next->pts != AV_NOPTS_VALUE) track->end_pts = next->pts; else track->end_pts = next->dts; + track->end_pts += ts_offset; } } } |