dvdplayer: disallow hw accel of SD mpeg2's
authorJoakim Plate <elupus@ecce.se>
Sun, 13 Oct 2013 11:12:03 +0000 (13:12 +0200)
committerJoakim Plate <elupus@ecce.se>
Sun, 13 Oct 2013 11:12:03 +0000 (13:12 +0200)
They are many dvd rips with non profile conformant streams that just
give garbage when rune using the hw decoder.

xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp

index 143675a..59dc781 100644 (file)
@@ -71,6 +71,14 @@ enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx
   if(!ctx->IsHardwareAllowed())
     return ctx->m_dllAvCodec.avcodec_default_get_format(avctx, fmt);
 
+  /* there are many corrupt mpeg2 rips from dvd's which don't *
+   * follow profile spec properly, they go corrupt on hw, so  *
+   * keep those running in software for the time being.       */
+  if (avctx->codec_id  == AV_CODEC_ID_MPEG2VIDEO
+  &&  avctx->height    <= 576
+  &&  avctx->width     <= 720)
+    return ctx->m_dllAvCodec.avcodec_default_get_format(avctx, fmt);
+
   const PixelFormat * cur = fmt;
   while(*cur != PIX_FMT_NONE)
   {