[FFmpeg-cvslog] avconv: support infinite loop for the loop option
Alexandra Hájková
git at videolan.org
Thu Oct 29 14:22:48 CET 2015
ffmpeg | branch: master | Alexandra Hájková <alexandra.khirnova at gmail.com> | Wed Oct 21 12:03:58 2015 +0200| [cd0e08813a0484002b5defbf557c859f123953ae] | committer: Luca Barbato
avconv: support infinite loop for the loop option
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd0e08813a0484002b5defbf557c859f123953ae
---
avconv.c | 5 +++--
doc/avconv.texi | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/avconv.c b/avconv.c
index ed0a3dd..493f9d2 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2329,7 +2329,8 @@ static int seek_to_start(InputFile *ifile, AVFormatContext *is)
ifile->time_base);
}
- ifile->loop--;
+ if (ifile->loop > 0)
+ ifile->loop--;
return ret;
}
@@ -2375,7 +2376,7 @@ static int process_input(void)
ifile->eagain = 1;
return ret;
}
- if ((ret < 0) && (ifile->loop > 1)) {
+ if (ret < 0 && ifile->loop) {
if ((ret = seek_to_start(ifile, is)) < 0)
return ret;
ret = get_input_packet(ifile, &pkt);
diff --git a/doc/avconv.texi b/doc/avconv.texi
index bee2039..6aaf445 100644
--- a/doc/avconv.texi
+++ b/doc/avconv.texi
@@ -254,7 +254,8 @@ Overwrite output files without asking.
Immediately exit when output files already exist.
@item -loop @var{number} (@emph{input})
-Set number of times input stream shall be looped.
+Set number of times input stream shall be looped. Loop 0 means no loop,
+loop -1 means infinite loop.
@item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
@itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
More information about the ffmpeg-cvslog
mailing list