All pastes #1423844 Raw Edit

Unnamed

public text v1 · immutable
#1423844 ·published 2009-05-15 16:38 UTC
rendered paste body
Index: libs/libmythtv/util-vdpau.cpp
===================================================================
--- libs/libmythtv/util-vdpau.cpp	(revision 20566)
+++ libs/libmythtv/util-vdpau.cpp	(working copy)
@@ -126,8 +126,7 @@
 {
 }
 
-bool VDPAUContext::Init(Display *disp, int screen,
-                        Window win, QSize screen_size,
+bool VDPAUContext::Init(Window win, QSize screen_size,
                         bool color_control, int color_key,
                         MythCodecID mcodecid)
 {
@@ -138,7 +137,7 @@
 
     bool ok;
 
-    ok = InitProcs(disp, screen);
+    ok = InitProcs();
     if (!ok)
         return ok;
 
@@ -181,8 +180,13 @@
     return &dummy[0];
 }
 
-bool VDPAUContext::InitProcs(Display *disp, int screen)
+bool VDPAUContext::InitProcs(void)
 {
+    Display* disp = MythXOpenDisplay();
+    if (!disp)
+        return false;
+    int screen = DefaultScreen(disp);
+
     VdpStatus vdp_st;
     bool ok = true;
     vdp_get_error_string = &dummy_get_error_string;
Index: libs/libmythtv/util-vdpau.h
===================================================================
--- libs/libmythtv/util-vdpau.h	(revision 20566)
+++ libs/libmythtv/util-vdpau.h	(working copy)
@@ -30,8 +30,7 @@
     VDPAUContext();
    ~VDPAUContext();
 
-    bool Init(Display *disp, int screen, Window win,
-              QSize screen_size, bool color_control,
+    bool Init(Window win, QSize screen_size, bool color_control,
               int color_key, MythCodecID mcodecid);
     void Deinit(void);
     VideoErrorState GetError(void) { return errorState; }
@@ -91,7 +90,7 @@
     void DeinitPIP(NuppelVideoPlayer *pipplayer, bool check_layer = true);
 
   private:
-    bool InitProcs(Display *disp, int screen);
+    bool InitProcs(void);
     void DeinitProcs(void);
     void ClearScreen(void);
 
Index: libs/libmythtv/videoout_xv.cpp
===================================================================
--- libs/libmythtv/videoout_xv.cpp	(revision 20566)
+++ libs/libmythtv/videoout_xv.cpp	(working copy)
@@ -1061,8 +1061,7 @@
     vdpau = new VDPAUContext();
 
     const QRect display_visible_rect = windows[0].GetDisplayVisibleRect();
-    bool ok = vdpau->Init(XJ_disp, XJ_screen_num, XJ_curwin,
-                          display_visible_rect.size(),
+    bool ok = vdpau->Init(XJ_curwin, display_visible_rect.size(),
                           db_use_picture_controls, vdpau_colorkey, mcodecid);
     if (!ok)
     {
@@ -4456,7 +4455,7 @@
             // Creating a second hardware decoder will still fail (180.25)
             // e.g. when attempting to use PBP.
             VDPAUContext *c = new VDPAUContext();
-            useVDPAU = c->Init(d, screen, curwin, QSize(1920,1200),
+            useVDPAU = c->Init(curwin, QSize(1920,1200),
                                false, 0, vdpau_codec_id);
             c->Deinit();
             delete c;