diff options
author | Sasi Inguva <isasi-at-google.com@ffmpeg.org> | 2018-03-21 13:36:38 -0700 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-03-24 03:11:08 +0100 |
commit | 829aebf95d44c1e850fd31692a273e6c6ab8161a (patch) | |
tree | d9b1b2bae15a58708f4c2fb7bc1901b77e88db3f /libavformat | |
parent | dc99ee6b08e54de13b4c82ff265609b6ab83e3d8 (diff) | |
download | ffmpeg-streaming-829aebf95d44c1e850fd31692a273e6c6ab8161a.zip ffmpeg-streaming-829aebf95d44c1e850fd31692a273e6c6ab8161a.tar.gz |
lavf/utils.c: Don't compute start_time from DISCARD packets for video.
Signed-off-by: Sasi Inguva <isasi@isasi.mtv.corp.google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 4d0b56c..f13c820 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1158,7 +1158,9 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index, } if (st->start_time == AV_NOPTS_VALUE) { - st->start_time = pts; + if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || !(pkt->flags & AV_PKT_FLAG_DISCARD)) { + st->start_time = pts; + } if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && st->codecpar->sample_rate) st->start_time += av_rescale_q(st->skip_samples, (AVRational){1, st->codecpar->sample_rate}, st->time_base); } |