lists.zerezo.com



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MPlayer-dev-eng] [PATCH] fix vo_xvidix x and y offset calculation



Hi,

On Mittwoch, 15. Oktober 2008, Reimar Döffinger wrote:
> On Wed, Oct 15, 2008 at 08:51:01PM +0200, Sascha Sommer wrote:
> > currently vidix seems to be broken. Attached patch fixes it for me.
> > Somehow the xinerama screen seems to be set to the default -1
> > what then adds random values to the x and y offsets leading to a broken
> > picture.
> >
> > Ok to commit?
>
> Well, I am not exactly sure WTF that code is exactly supposed to do, but
> I think
> 1) it misuses xinerama_screen variable which is supposed to contain the
> commandline option to save its internal state
> 2) you probably can do this much simpler by replacing the whole code
> with
>
> > update_xinerama_info();
> > drwcX -= xinerama_x;
> > drwcY -= xinerama_y;
>

New patch attached.

> There probably is a lot more code that is (no longer) necessary in there
> but I feel somewhat low on motivation to work on something that
> unfortunately is likely to have no future at all.
>

I'm also not very motivated but xvidix is still a nice to have feature for 
those ancient machines where no xv support is available.

Regards

Sascha
Index: libvo/vo_xvidix.c
===================================================================
--- libvo/vo_xvidix.c	(revision 27776)
+++ libvo/vo_xvidix.c	(working copy)
@@ -124,45 +124,10 @@
     vo_dwidth = drwWidth;
     vo_dheight = drwHeight;
 
-#ifdef CONFIG_XINERAMA
-    if (XineramaIsActive(mDisplay))
-    {
-        XineramaScreenInfo *screens;
-        int num_screens;
-        int i = 0;
+    update_xinerama_info();
+    drwcX -= xinerama_x;
+    drwcY -= xinerama_y;
 
-        screens = XineramaQueryScreens(mDisplay, &num_screens);
-
-        /* find the screen we are on */
-        while (i < num_screens &&
-               ((screens[i].x_org < drwcX) || (screens[i].y_org < drwcY) ||
-                (screens[i].x_org + screens[i].width >= drwcX) ||
-                (screens[i].y_org + screens[i].height >= drwcY)))
-        {
-            i++;
-        }
-
-        if (i < num_screens)
-        {
-            /* save the screen we are on */
-            xinerama_screen = i;
-        } else
-        {
-            /* oops.. couldnt find the screen we are on
-             * because the upper left corner left the
-             * visual range. assume we are still on the
-             * same screen
-             */
-            i = xinerama_screen;
-        }
-
-        /* set drwcX and drwcY to the right values */
-        drwcX = drwcX - screens[i].x_org;
-        drwcY = drwcY - screens[i].y_org;
-        XFree(screens);
-    }
-#endif
-
     if (vo_panscan > 0.0f && vo_fs)
     {
         drwcX -= vo_panscan_x >> 1;
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng