From a58873b11198d04670b7f98f5a8a749d742db7c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20Gro=C3=9Fe?= <pegro@friiks.de>
Date: Fri, 30 Jun 2017 17:28:53 +0200
Subject: [PATCH] avconv: when using -loop option bail out if seek to start
 fails
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes an infinite loop when a demuxer fails to seek to the start of the input.

Signed-off-by: Peter Große <pegro@friiks.de>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
 avtools/avconv.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/avtools/avconv.c b/avtools/avconv.c
index 8dd11bb5fc4..4e3ffecdefe 100644
--- a/avtools/avconv.c
+++ b/avtools/avconv.c
@@ -2615,9 +2615,11 @@ static int process_input(void)
         return ret;
     }
     if (ret < 0 && ifile->loop) {
-        if ((ret = seek_to_start(ifile, is)) < 0)
-            return ret;
-        ret = get_input_packet(ifile, &pkt);
+        ret = seek_to_start(ifile, is);
+        if(ret < 0)
+            av_log(NULL, AV_LOG_WARNING, "Seek to start failed.\n");
+        else
+            ret = get_input_packet(ifile, &pkt);
     }
     if (ret < 0) {
         if (ret != AVERROR_EOF) {
-- 
GitLab