Commit f86e5ebb authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Avcodec: Fix slice-decoding of hwAccel + -mt

Close #5909 #5867
parent a1ded9a8
......@@ -363,14 +363,17 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
i_codec_id == CODEC_ID_VC1 || i_codec_id == CODEC_ID_WMV3) )
{
#ifdef HAVE_AVCODEC_MT
if( ( p_sys->p_context->thread_type & FF_THREAD_FRAME ) ||
( ( p_sys->p_context->thread_type & FF_THREAD_SLICE ) &&
( i_codec_id == CODEC_ID_MPEG1VIDEO || i_codec_id == CODEC_ID_MPEG2VIDEO ) )
)
if( p_sys->p_context->thread_type & FF_THREAD_FRAME )
{
msg_Warn( p_dec, "threaded frame decoding is not compatible with ffmpeg-hw, disabled" );
p_sys->p_context->thread_type &= ~FF_THREAD_FRAME;
}
if( ( p_sys->p_context->thread_type & FF_THREAD_SLICE ) &&
( i_codec_id == CODEC_ID_MPEG1VIDEO || i_codec_id == CODEC_ID_MPEG2VIDEO ) )
{
msg_Warn( p_dec, "threaded slice decoding is not compatible with ffmpeg-hw, disabled" );
p_sys->p_context->thread_type &= ~FF_THREAD_SLICE;
}
#endif
p_sys->p_context->get_format = ffmpeg_GetFormat;
}
......
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