mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-12 18:10:13 +01:00
fftools/ffmpeg: make specifying thread_queue_size turn on threaded input
Threaded input can increase smoothness of e.g. x11grab significantly. Before this patch, in order to activate threaded input the user had to specify a "dummy" additional input, with this change it is no longer required. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
@@ -4051,7 +4051,9 @@ static int init_input_thread(int i)
|
||||
int ret;
|
||||
InputFile *f = input_files[i];
|
||||
|
||||
if (nb_input_files == 1)
|
||||
if (f->thread_queue_size < 0)
|
||||
f->thread_queue_size = (nb_input_files > 1 ? 8 : 0);
|
||||
if (!f->thread_queue_size)
|
||||
return 0;
|
||||
|
||||
if (f->ctx->pb ? !f->ctx->pb->seekable :
|
||||
@@ -4105,7 +4107,7 @@ static int get_input_packet(InputFile *f, AVPacket *pkt)
|
||||
}
|
||||
|
||||
#if HAVE_THREADS
|
||||
if (nb_input_files > 1)
|
||||
if (f->thread_queue_size)
|
||||
return get_input_packet_mt(f, pkt);
|
||||
#endif
|
||||
return av_read_frame(f->ctx, pkt);
|
||||
|
||||
Reference in New Issue
Block a user