[FFmpeg-devel] [PATCH] ffmpeg.c: Fallback to duration_dts, when duration_pts can't be determined.

Sasi Inguva isasi at google.com
Tue Oct 10 04:27:07 EEST 2017


This is required for FLV files, for which duration_pts comes out to be zero.

Signed-off-by: Sasi Inguva <isasi at google.com>
---
 fftools/ffmpeg.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 6d64bc1043..5f373db847 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2665,6 +2665,9 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
                     ist->next_dts = AV_NOPTS_VALUE;
             }
 
+            if (duration_pts == 0)
+                duration_pts = duration_dts;
+
             if (got_output)
                 ist->next_pts += av_rescale_q(duration_pts, ist->st->time_base, AV_TIME_BASE_Q);
             break;
-- 
2.14.2.920.gcf0c67979c-goog



More information about the ffmpeg-devel mailing list