[vlc-commits] opengl: fixed playback of 10bit content on Macs with OpenGL 1.4 drivers, notably using the GMA 950 chipset (close #5973)

Felix Paul Kühne git at videolan.org
Sat Jun 9 11:58:42 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sat Jun  9 11:50:48 2012 +0200| [701d1347faa29f52b0a04c587724deb6de1ae28e] | committer: Felix Paul Kühne

opengl: fixed playback of 10bit content on Macs with OpenGL 1.4 drivers, notably using the GMA 950 chipset (close #5973)

We do so by forcefully disabling the 16bit shaders, which the chipset pretends to support, but actually doesn't.
(cherry picked from commit adcc3b14a16c712af51bfc9b7940921a9e6b3468)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=701d1347faa29f52b0a04c587724deb6de1ae28e
---

 NEWS                          |    2 ++
 modules/video_output/opengl.c |   18 ++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/NEWS b/NEWS
index 97d5217..403ad02 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ Video Output:
  * Misc fixes in OpenGL module, on all platforms
  * Fix video output on PowerPC-based Macs equipped with an ATI Radeon 7500,
    an ATI Radeon 9200 or a NVIDIA GeForceFX 5200 Ultra.
+ * Fix video output of 10bit encoded contents on Intel-based Macs equipped
+   with an Intel GMA 950 chipset running OS X 10.6 or later.
 
 Access:
  * Rework Digital TV module for Windows. DVB-T and DVB-C should work again
diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index e64b219..71ab7ff 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -130,6 +130,24 @@ static inline int GetAlignedSize(unsigned size)
 
 static bool IsLuminance16Supported(int target)
 {
+#if defined(MACOS_OPENGL)
+    /* OpenGL 1.x on OS X does _not_ support 16bit shaders, but pretends to.
+     * That's why we enforce return false here, even though the actual code below
+     * would return true.
+     * This fixes playback of 10bit content on the Intel GMA 950 chipset, which is
+     * the only "GPU" supported by 10.6 and 10.7 with just an OpenGL 1.4 driver.
+     *
+     * Presumely, this also improves playback on the GMA 3100, GeForce FX 5200,
+     * GeForce4 Ti, GeForce3, GeForce2 MX/4 MX and the Radeon 8500 when
+     * running OS X 10.5. */
+    const GLubyte * p_glversion;
+    float f_glversion;
+    p_glversion = glGetString (GL_VERSION);
+    sscanf((char *)p_glversion, "%f", &f_glversion);
+    if (f_glversion < 2)
+        return false;
+#endif
+
     GLuint texture;
 
     glGenTextures(1, &texture);



More information about the vlc-commits mailing list