Commit 2b006ccf authored by Sasi Inguva's avatar Sasi Inguva Committed by Michael Niedermayer

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: 's avatarSasi Inguva <isasi@google.com>
Reviewed-by: 's avatarThomas Mundt <tmundt75@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 37caed77
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment