Commit 015b33bc authored by Ilkka Ollakka's avatar Ilkka Ollakka

avcodec: blacklist some codecs for multithreading

libavcodec doesn't allow multiple threads on some codecs, so blacklist them
to have only 1. Not sure if it would be easier just to revert few commits to
default whole to 1 thread.

I did't spot any other codecs that would exit if thread_count > 1 in libavcodec.

Fix #3613
parent 6db40aa9
......@@ -499,6 +499,23 @@ int OpenEncoder( vlc_object_t *p_this )
if ( p_sys->i_qmin > 0 && p_sys->i_qmin == p_sys->i_qmax )
p_context->flags |= CODEC_FLAG_QSCALE;
/* These codecs cause libavcodec to exit if thread_count is > 1.
See libavcodec/mpegvideo_enc.c:MPV_encode_init
*/
if ( i_codec_id == CODEC_ID_FLV1 ||
i_codec_id == CODEC_ID_H261 ||
i_codec_id == CODEC_ID_LJPEG ||
i_codec_id == CODEC_ID_MJPEG ||
i_codec_id == CODEC_ID_H263 ||
i_codec_id == CODEC_ID_H263P ||
i_codec_id == CODEC_ID_MSMPEG4V1 ||
i_codec_id == CODEC_ID_MSMPEG4V2 ||
i_codec_id == CODEC_ID_MSMPEG4V3 ||
i_codec_id == CODEC_ID_WMV1 ||
i_codec_id == CODEC_ID_RV10 ||
i_codec_id == CODEC_ID_RV20 ||
i_codec_id == CODEC_ID_SVQ3 )
p_enc->i_threads = 1;
if ( p_enc->i_threads >= 1 )
avcodec_thread_init( p_context, p_enc->i_threads );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment