Skip to content
Browse files

Ensure that the decoder is init once only.

This fixes the crash while playing MPEG2 files with sequence display extension.
  • Loading branch information...
1 parent bb91e71 commit 6d637d4801095acfe5b6a7e56f446aa2e4602bfa @anuj-m committed Dec 18, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
View
5 xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
@@ -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))
{

0 comments on commit 6d637d4

Please sign in to comment.
Something went wrong with that request. Please try again.