[vlc-commits] commit: Disabled GPU acceleration when using ffmpeg-mt. (Laurent Aimar )
git at videolan.org
git at videolan.org
Fri May 14 22:34:08 CEST 2010
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu May 13 20:25:03 2010 +0200| [963ba769c2b62fb2e7d08848f378e1336924d1d2] | committer: Laurent Aimar
Disabled GPU acceleration when using ffmpeg-mt.
It segfaults otherwise.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=963ba769c2b62fb2e7d08848f378e1336924d1d2
---
modules/codec/avcodec/video.c | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index a9dc44f..ad71de5 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -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->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
int i_thread_count = var_InheritInteger( p_dec, "ffmpeg-threads" );
if( i_thread_count <= 0 )
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
+ const bool b_use_hw = var_CreateGetBool( p_dec, "ffmpeg-hw" );
if( b_use_hw )
{
- if( i_thread_count > 1 )
- msg_Err( p_dec, "ffmpeg-hw and ffmpeg-threads options are not compatible" );
- i_thread_count = 1;
- }
+#ifdef HAVE_AVCODEC_MT
+ msg_Err( p_dec, "ffmpeg-hw is not compatible with ffmpeg-mt" );
+#else
+ p_sys->p_context->get_format = ffmpeg_GetFormat;
#endif
- msg_Dbg( p_dec, "allowing %d thread(s) for decoding", i_thread_count );
- p_sys->p_context->thread_count = i_thread_count;
+ }
#endif
-
/* ***** misc init ***** */
p_sys->i_pts = VLC_TS_INVALID;
p_sys->b_has_b_frames = false;
More information about the vlc-commits
mailing list