[vlc-devel] commit: Properly detect XvMC capabilities. (Jean-Paul Saman )

git version control git at videolan.org
Thu Apr 10 20:01:42 CEST 2008


vlc | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Thu Apr 10 20:01:51 2008 +0200| [b6cdf137040a4c01b2340eb921a3509c4133a930]

Properly detect XvMC capabilities.

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

 modules/video_output/x11/xcommon.c |    2 +-
 modules/video_output/x11/xvmc.c    |   14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/x11/xcommon.c b/modules/video_output/x11/xcommon.c
index c3c686f..0f7000b 100644
--- a/modules/video_output/x11/xcommon.c
+++ b/modules/video_output/x11/xcommon.c
@@ -426,7 +426,7 @@ int E_(Activate) ( vlc_object_t *p_this )
     msg_Dbg(p_vout, "Deinterlace = %d", p_vout->p_sys->xvmc_deinterlace_method);
     msg_Dbg(p_vout, "Crop = %d", p_vout->p_sys->xvmc_crop_style);
 
-    if( !checkXvMCCap( p_vout ) )
+    if( checkXvMCCap( p_vout ) == VLC_EGENERIC )
     {
         msg_Err( p_vout, "no XVMC capability found" );
         E_(Deactivate)( p_vout );
diff --git a/modules/video_output/x11/xvmc.c b/modules/video_output/x11/xvmc.c
index 01aeb62..a4ed98b 100644
--- a/modules/video_output/x11/xvmc.c
+++ b/modules/video_output/x11/xvmc.c
@@ -745,25 +745,27 @@ int checkXvMCCap( vout_thread_t *p_vout )
     XFree(surfaceInfo);
 
     /*
-    * Try to create a direct rendering context. This will fail if we are not
-    * on the displaying computer or an indirect context is not available.
-    */
+     * Try to create a direct rendering context. This will fail if we are not
+     * on the displaying computer or an indirect context is not available.
+     */
     XVMCUNLOCKDISPLAY( p_vout->p_sys->p_display );
     curCap = p_vout->p_sys->xvmc_cap;
     if( Success == XvMCCreateContext( p_vout->p_sys->p_display, i_xvport,
                                       curCap->type_id,
                                       curCap->max_width,
                                       curCap->max_height,
-                                      XVMC_DIRECT, &c) )
+                                      XVMC_DIRECT, &c ) )
     {
-            p_vout->p_sys->context_flags = XVMC_DIRECT;
+        msg_Dbg( p_vout, "using direct XVMC rendering context" );
+        p_vout->p_sys->context_flags = XVMC_DIRECT;
     }
     else if( Success == XvMCCreateContext( p_vout->p_sys->p_display, i_xvport,
                                            curCap->type_id,
                                            curCap->max_width,
                                            curCap->max_height,
-                                           0, &c) )
+                                           0, &c ) )
     {
+        msg_Dbg( p_vout, "using default XVMC rendering context" );
         p_vout->p_sys->context_flags = 0;
     }
     else




More information about the vlc-devel mailing list