This commit is contained in:
veejay
2023-09-17 03:25:07 +02:00
parent aae4b90ee7
commit 659626854e
2 changed files with 16 additions and 1 deletions

View File

@@ -617,6 +617,14 @@ static int v4l2_setup_avcodec_capture( v4l2info *v, int wid, int hei, int codec_
v->c->flags |= CODEC_FLAG_TRUNCATED;
#if LIBAVCODEC_BUILD > 5400
int n_threads = avhelper_set_num_decoders();
if( n_threads > 0 ) {
e->context->thread_count = n_threads;
e->context->thread_type = FF_THREAD_FRAME;
}
if( avcodec_open2( v->c, v->codec, NULL ) < 0 )
#else
if( avcodec_open( v->c, v->codec ) < 0 )