[FFmpeg-devel] [PATCH, V3] avformat/concat: Fix wrong wrapped timestamp
mymoeyard at gmail.com
mymoeyard at gmail.com
Fri Dec 29 13:10:50 EET 2017
From: Wu Zhiqiang <mymoeyard at gmail.com>
When using concat protocol, start from middle of file will generate non-zero wrap reference.
If seek to time before the wrap reference, wrap control will generate wrong wrapped timestamp.
Copy wrap related stream properties when reading header can fix this problem.
Signed-off-by: Wu Zhiqiang <mymoeyard at gmail.com>
---
libavformat/concatdec.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 0e189012ad..8ea9c2b02d 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -188,6 +188,12 @@ static int copy_stream_props(AVStream *st, AVStream *source_st)
st->time_base = source_st->time_base;
st->sample_aspect_ratio = source_st->sample_aspect_ratio;
+ /* Fix wrap control problem */
+ avpriv_set_pts_info(st, source_st->pts_wrap_bits, source_st->time_base.num,
+ source_st->time_base.den);
+ st->pts_wrap_behavior = source_st->pts_wrap_behavior;
+ st->pts_wrap_reference = source_st->pts_wrap_reference;
+
av_dict_copy(&st->metadata, source_st->metadata, 0);
return 0;
}
--
2.15.0
More information about the ffmpeg-devel
mailing list