Skip to content

Commit

Permalink
dvdplayer - dispose ffmpeg hw decoder prior to opening a new one
Browse files Browse the repository at this point in the history
  • Loading branch information
FernetMenta committed Jul 26, 2015
1 parent d44bc81 commit 013156f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
return avcodec_default_get_format(avctx, fmt);
}

// hardware decoder de-selected, restore standard ffmpeg
if (ctx->GetHardware())
{
ctx->SetHardware(NULL);
avctx->get_buffer2 = avcodec_default_get_buffer2;
avctx->slice_flags = 0;
avctx->hwaccel_context = 0;
}

const PixelFormat * cur = fmt;
while(*cur != PIX_FMT_NONE)
{
Expand Down Expand Up @@ -159,15 +168,6 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
cur++;
}

// hardware decoder de-selected, restore standard ffmpeg
if (ctx->GetHardware())
{
ctx->SetHardware(NULL);
avctx->get_buffer2 = avcodec_default_get_buffer2;
avctx->slice_flags = 0;
avctx->hwaccel_context = 0;
}

ctx->m_decoderState = STATE_HW_FAILED;
return avcodec_default_get_format(avctx, fmt);
}
Expand Down

0 comments on commit 013156f

Please sign in to comment.