Commit 963ba769 authored by Laurent Aimar's avatar Laurent Aimar

Disabled GPU acceleration when using ffmpeg-mt.

It segfaults otherwise.
parent bf4e7c9a
...@@ -332,29 +332,26 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context, ...@@ -332,29 +332,26 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
p_sys->p_context->release_buffer = ffmpeg_ReleaseFrameBuf; p_sys->p_context->release_buffer = ffmpeg_ReleaseFrameBuf;
p_sys->p_context->opaque = p_dec; p_sys->p_context->opaque = p_dec;
#ifdef HAVE_AVCODEC_VA
const bool b_use_hw = var_CreateGetBool( p_dec, "ffmpeg-hw" );
if( b_use_hw )
p_sys->p_context->get_format = ffmpeg_GetFormat;
#endif
#ifdef HAVE_AVCODEC_MT #ifdef HAVE_AVCODEC_MT
int i_thread_count = var_InheritInteger( p_dec, "ffmpeg-threads" ); int i_thread_count = var_InheritInteger( p_dec, "ffmpeg-threads" );
if( i_thread_count <= 0 ) if( i_thread_count <= 0 )
i_thread_count = vlc_GetCPUCount(); i_thread_count = vlc_GetCPUCount();
msg_Dbg( p_dec, "allowing %d thread(s) for decoding", i_thread_count );
p_sys->p_context->thread_count = i_thread_count;
#endif
#ifdef HAVE_AVCODEC_VA #ifdef HAVE_AVCODEC_VA
const bool b_use_hw = var_CreateGetBool( p_dec, "ffmpeg-hw" );
if( b_use_hw ) if( b_use_hw )
{ {
if( i_thread_count > 1 ) #ifdef HAVE_AVCODEC_MT
msg_Err( p_dec, "ffmpeg-hw and ffmpeg-threads options are not compatible" ); msg_Err( p_dec, "ffmpeg-hw is not compatible with ffmpeg-mt" );
i_thread_count = 1; #else
} p_sys->p_context->get_format = ffmpeg_GetFormat;
#endif #endif
msg_Dbg( p_dec, "allowing %d thread(s) for decoding", i_thread_count ); }
p_sys->p_context->thread_count = i_thread_count;
#endif #endif
/* ***** misc init ***** */ /* ***** misc init ***** */
p_sys->i_pts = VLC_TS_INVALID; p_sys->i_pts = VLC_TS_INVALID;
p_sys->b_has_b_frames = false; p_sys->b_has_b_frames = false;
......
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