You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-11 14:30:22 +02:00
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>
(cherry picked from commit da36bcbeb7
)
This commit is contained in:
@ -4213,7 +4213,7 @@ static int process_input(int file_index)
|
|||||||
AVFormatContext *is;
|
AVFormatContext *is;
|
||||||
InputStream *ist;
|
InputStream *ist;
|
||||||
AVPacket pkt;
|
AVPacket pkt;
|
||||||
int ret, i, j;
|
int ret, thread_ret, i, j;
|
||||||
int64_t duration;
|
int64_t duration;
|
||||||
int64_t pkt_dts;
|
int64_t pkt_dts;
|
||||||
|
|
||||||
@ -4236,7 +4236,15 @@ static int process_input(int file_index)
|
|||||||
avcodec_flush_buffers(avctx);
|
avcodec_flush_buffers(avctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if HAVE_THREADS
|
||||||
|
free_input_thread(file_index);
|
||||||
|
#endif
|
||||||
ret = seek_to_start(ifile, is);
|
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)
|
if (ret < 0)
|
||||||
av_log(NULL, AV_LOG_WARNING, "Seek to start failed.\n");
|
av_log(NULL, AV_LOG_WARNING, "Seek to start failed.\n");
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user