summaryrefslogtreecommitdiff
path: root/avtools
diff options
context:
space:
mode:
authorPeter Große <pegro@friiks.de>2017-10-30 12:25:26 +0100
committerDiego Biurrun <diego@biurrun.de>2017-11-04 17:58:47 +0100
commit22241208eb7d0168b2afc128af5a128a9ef0a89b (patch)
tree266ea151511bee3a344e7d90ab0b8cd0e5929e2b /avtools
parent55fe72a841ba306370e68e86c88f34b4456aa4dd (diff)
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>
Diffstat (limited to 'avtools')
-rw-r--r--avtools/avconv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/avtools/avconv.c b/avtools/avconv.c
index 4e3ffecdef..cee7a7b452 100644
--- a/avtools/avconv.c
+++ b/avtools/avconv.c
@@ -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)