summaryrefslogtreecommitdiff
path: root/fftools
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2018-06-27 22:27:01 +0200
committerMarton Balint <cus@passwd.hu>2018-07-02 11:58:08 +0200
commitda36bcbeb78c78e493d18d3cd3ac92ea401e7031 (patch)
tree69223e2aa7e112ee6c5cb83e057493474209e649 /fftools
parentb181cd359b872283d5fcaf7c553bbad88517c78b (diff)
ffmpeg: fix -stream_loop with multiple inputs
The input thread needs to be properly cleaned up and re-initalized before we can start reading again in threaded mode. (Threaded input reading is used when there is mode than one input file). Fixes ticket #6121 and #7043. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'fftools')
-rw-r--r--fftools/ffmpeg.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index c743af2ae8..55faec8ede 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -4251,7 +4251,7 @@ static int process_input(int file_index)
AVFormatContext *is;
InputStream *ist;
AVPacket pkt;
- int ret, i, j;
+ int ret, thread_ret, i, j;
int64_t duration;
int64_t pkt_dts;
@@ -4274,7 +4274,15 @@ static int process_input(int file_index)
avcodec_flush_buffers(avctx);
}
}
+#if HAVE_THREADS
+ free_input_thread(file_index);
+#endif
ret = seek_to_start(ifile, is);
+#if HAVE_THREADS
+ thread_ret = init_input_thread(file_index);
+ if (thread_ret < 0)
+ return thread_ret;
+#endif
if (ret < 0)
av_log(NULL, AV_LOG_WARNING, "Seek to start failed.\n");
else