1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avconv.c: fix calculation of input file duration in seek_to_start()

Fixes looping files without audio or when using stream_copy, where
ist->nb_samples is not set since no decoding is done.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
Peter Große 2017-10-30 12:25:26 +01:00 committed by Diego Biurrun
parent 55fe72a841
commit 22241208eb

View File

@ -2553,9 +2553,9 @@ static int seek_to_start(InputFile *ifile, AVFormatContext *is)
continue;
} else {
if (ist->framerate.num) {
duration = av_rescale_q(1, ist->framerate, ist->st->time_base);
duration = FFMAX(av_rescale_q(1, av_inv_q(ist->framerate), ist->st->time_base), 1);
} else if (ist->st->avg_frame_rate.num) {
duration = av_rescale_q(1, ist->st->avg_frame_rate, ist->st->time_base);
duration = FFMAX(av_rescale_q(1, av_inv_q(ist->st->avg_frame_rate), ist->st->time_base), 1);
} else duration = 1;
}
if (!ifile->duration)