Sunday, December 01, 2024

Re: mplayer generates X11 errors and no longer renders video

On Fri, Nov 29, 2024 at 09:07:16PM -0500, Brad Smith wrote:
> On 2024-11-29 4:10 p.m., Stuart Henderson wrote:
> > dmesg is missing. It would also be helpful to include pkg_info to see
> > which packages are installed (both for version numbers of things, and
> > to see if anything vaapi-related is there).
>
>
> The last part is not relevant for MPlayer, but more details are necessary.
>

Hi Brad,

I can reproduce this with mplayer-20240803. This is caused by mplayer
still using the 20th century XSHM api and having changed shmget() to
create the shared memory segment with mode 0600 instead of 0777.

The patch below to the mplayer port should fix it.

ok ?

Index: Makefile
===================================================================
RCS file: /local/cvs/ports/x11/mplayer/Makefile,v
diff -u -p -u -r1.332 Makefile
--- Makefile 29 Nov 2024 09:52:09 -0000 1.332
+++ Makefile 1 Dec 2024 14:56:36 -0000
@@ -3,7 +3,7 @@ COMMENT= movie player supporting many fo
V= 20240803
FFMPEG_V= 6.1.2
DISTNAME= mplayer-${V}
-REVISION= 0
+REVISION= 1
CATEGORIES= x11 multimedia
SITES= https://comstyle.com/source/
EXTRACT_SUFX= .tar.xz
Index: patches/patch-libvo_vo_x11_c
===================================================================
RCS file: patches/patch-libvo_vo_x11_c
diff -N patches/patch-libvo_vo_x11_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-libvo_vo_x11_c 1 Dec 2024 14:56:36 -0000
@@ -0,0 +1,12 @@
+Index: libvo/vo_x11.c
+--- libvo/vo_x11.c.orig
++++ libvo/vo_x11.c
+@@ -150,7 +150,7 @@ static void getMyXImage(void)
+ }
+ Shminfo[0].shmid = shmget(IPC_PRIVATE,
+ myximage->bytes_per_line *
+- myximage->height, IPC_CREAT | SHM_R | SHM_W);
++ myximage->height, IPC_CREAT | 0777);
+ if (Shminfo[0].shmid < 0)
+ {
+ XDestroyImage(myximage);
Index: patches/patch-libvo_vo_xv_c
===================================================================
RCS file: patches/patch-libvo_vo_xv_c
diff -N patches/patch-libvo_vo_xv_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-libvo_vo_xv_c 1 Dec 2024 14:56:36 -0000
@@ -0,0 +1,12 @@
+Index: libvo/vo_xv.c
+--- libvo/vo_xv.c.orig
++++ libvo/vo_xv.c
+@@ -279,7 +279,7 @@ static void allocate_xvimage(int foo)
+ &Shminfo[foo]);
+
+ Shminfo[foo].shmid =
+- shmget(IPC_PRIVATE, xvimage[foo]->data_size, IPC_CREAT | SHM_R | SHM_W);
++ shmget(IPC_PRIVATE, xvimage[foo]->data_size, IPC_CREAT | 0777);
+ Shminfo[foo].shmaddr = (char *) shmat(Shminfo[foo].shmid, 0, 0);
+ Shminfo[foo].readOnly = False;
+

--
Matthieu Herrb

No comments:

Post a Comment