Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[vaapi] Fix crash while playing mpeg2 files #1954

Merged
1 commit merged into from Apr 6, 2013
Jump to file or symbol
Failed to load files and symbols.
+5 −0
Split
@@ -105,6 +105,11 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
if(*cur == PIX_FMT_VAAPI_VLD && g_guiSettings.GetBool("videoplayer.usevaapi")
&& (avctx->codec_id != CODEC_ID_MPEG4 || g_advancedSettings.m_videoAllowMpeg4VAAPI))
{
+ if (ctx->GetHardware() != NULL)
+ {
+ ctx->SetHardware(NULL);
+ }
+
VAAPI::CDecoder* dec = new VAAPI::CDecoder();
if(dec->Open(avctx, *cur))
{