diff options
author | Sasi Inguva <isasi-at-google.com@ffmpeg.org> | 2017-10-10 10:36:58 -0700 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-10-15 01:43:23 +0200 |
commit | 8500de89ea9111e859c1ca8c51e7a3ed2ff76846 (patch) | |
tree | f42e3c35456c4bc212672b5b54bb74e4f7723b9c | |
parent | a11a18b284afd5ac58fd3b1835f8a3608c4ebc9f (diff) | |
download | ffmpeg-8500de89ea9111e859c1ca8c51e7a3ed2ff76846.tar.gz |
ffmpeg.c: Fallback to duration_dts, when duration_pts can't be determined.
This is required for FLV files, for which duration_pts comes out to be zero.
Signed-off-by: Sasi Inguva <isasi@google.com>
Reviewed-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2b006ccf8318d84101ed83b75df4c9682a963217)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | fftools/ffmpeg.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 6d64bc1043..3ee31473dc 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2665,8 +2665,13 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo ist->next_dts = AV_NOPTS_VALUE; } - if (got_output) - ist->next_pts += av_rescale_q(duration_pts, ist->st->time_base, AV_TIME_BASE_Q); + if (got_output) { + if (duration_pts > 0) { + ist->next_pts += av_rescale_q(duration_pts, ist->st->time_base, AV_TIME_BASE_Q); + } else { + ist->next_pts += duration_dts; + } + } break; case AVMEDIA_TYPE_SUBTITLE: if (repeating) |