merge r33908, [chd] refactor factory selector to allow h264 > 700 to be picked
authordavilla <davilla@svn>
Thu, 16 Sep 2010 23:45:41 +0000 (23:45 +0000)
committerdavilla <davilla@svn>
Thu, 16 Sep 2010 23:45:41 +0000 (23:45 +0000)
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@33910 568bbfeb-2a22-0410-94d2-cc84cf5bfa90

xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp

index 0babd48..36ea274 100644 (file)
@@ -184,14 +184,24 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec( CDVDStreamInfo &hint )
 #endif
 
 #if defined(HAVE_LIBCRYSTALHD)
-  if (hint.width > 720 && CCrystalHD::GetInstance()->DevicePresent())
+  if (!hint.software && g_guiSettings.GetBool("videoplayer.usechd"))
   {
-    if (g_guiSettings.GetBool("videoplayer.usechd") && !hint.software)
+    if (CCrystalHD::GetInstance()->DevicePresent())
     {
-      if (hint.codec == CODEC_ID_VC1 || hint.codec == CODEC_ID_H264 || hint.codec == CODEC_ID_MPEG2VIDEO)
+      switch(hint.codec)
       {
-        CLog::Log(LOGINFO, "Trying Broadcom Crystal HD Decoder...");
-        if ( (pCodec = OpenCodec(new CDVDVideoCodecCrystalHD(), hint, options)) ) return pCodec;
+        case CODEC_ID_VC1:
+        case CODEC_ID_H264:
+        case CODEC_ID_MPEG2VIDEO:
+          if (hint.codec == CODEC_ID_H264 && hint.width <= 700)
+            break;
+          if (hint.codec == CODEC_ID_MPEG2VIDEO && hint.width <= 720)
+            break;
+          CLog::Log(LOGINFO, "Trying Broadcom Crystal HD Decoder...");
+          if ( (pCodec = OpenCodec(new CDVDVideoCodecCrystalHD(), hint, options)) ) return pCodec;
+        break;
+        default:
+        break;
       }
     }
   }