lavf/concatdec: properly init streams timestamp parameters.
authorNicolas George <george@nsup.org>
Sat, 30 Dec 2017 11:17:08 +0000 (12:17 +0100)
committerNicolas George <george@nsup.org>
Sun, 31 Dec 2017 09:33:24 +0000 (10:33 +0100)
pts_wrap_bits defaults to 33 (like MPEG), that causes valid
timestamps to be unwrapped and become invalid.
Inspired by a patch by Wu Zhiqiang <mymoeyard@gmail.com>.

libavformat/concatdec.c

index 0e18901..bd5174a 100644 (file)
@@ -185,8 +185,8 @@ static int copy_stream_props(AVStream *st, AVStream *source_st)
         return ret;
     st->r_frame_rate        = source_st->r_frame_rate;
     st->avg_frame_rate      = source_st->avg_frame_rate;
-    st->time_base           = source_st->time_base;
     st->sample_aspect_ratio = source_st->sample_aspect_ratio;
+    avpriv_set_pts_info(st, 64, source_st->time_base.num, source_st->time_base.den);
 
     av_dict_copy(&st->metadata, source_st->metadata, 0);
     return 0;