VDPAU: Distinguish between nvidia and others when checking settings
authorfritsch <Peter.Fruehberger@gmail.com>
Wed, 12 Feb 2014 07:57:53 +0000 (08:57 +0100)
committerfritsch <Peter.Fruehberger@gmail.com>
Wed, 12 Feb 2014 08:36:55 +0000 (09:36 +0100)
xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp

index 79f8cea..98183a2 100644 (file)
@@ -496,8 +496,14 @@ CDecoder::CDecoder() : m_vdpauOutput(&m_inMsgEvent)
 bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned int surfaces)
 {
   // check if user wants to decode this format with VDPAU
-  if (CDVDVideoCodec::IsCodecDisabled(g_vdpau_available, settings_count, avctx->codec_id))
-    return false;
+  std::string gpuvendor = g_Windowing.GetRenderVendor();
+  std::transform(gpuvendor.begin(), gpuvendor.end(), gpuvendor.begin(), ::tolower);
+  // nvidia is whitelisted despite for mpeg-4 we need to query user settings
+  if ((gpuvendor.compare(0, 6, "nvidia") != 0)  || (avctx->codec_id == AV_CODEC_ID_MPEG4) || (avctx->codec_id == AV_CODEC_ID_H263))
+  {
+    if (CDVDVideoCodec::IsCodecDisabled(g_vdpau_available, settings_count, avctx->codec_id))
+      return false;
+  }
 
 #ifndef GL_NV_vdpau_interop
   CLog::Log(LOGNOTICE, "VDPAU: compilation without required extension GL_NV_vdpau_interop");