Hello,
While working on the libmpeg2 sources for the OW2 Fractal project, I
soon noticed that:
* the X11 video output plugin of upstream HEAD does not work well: the
framerate was limited to 1 FPS;
* the Debian stable (I'm running SimplyMEPIS 7.0) package "mpeg2dec",
which has version 0.4.0b-4, works fine.
I worked around this by using the SDL output plugin. But now that I'm on
holiday, I made a bisection (with GIT), to find out what happens. A
dozen minutes after starting, git-bisect tells me that:
1bbfe462f16d309a53af5e7bd56abfc6ef7eb05f is first bad commit
Commit 1bbfe462f16d309a53af5e7bd56abfc6ef7eb05f is:
Author: sammy <[EMAIL PROTECTED]>
Date: Tue Feb 14 16:32:51 2006 +0000
Fix shm leakage in mpeg2dec on remote displays, courtesy of Nicolas
Joly.
git-svn-id: svn://svn.videolan.org/[EMAIL PROTECTED]
69194b2d-ca13-0410-9ec0-9203f42c7898
Looking at the diff between this commit and the previous one, the cause
of the slowdown is obvious:
@@ -266,6 +271,7 @@ static void x11_draw_frame (vo_instance_t * _instance,
instance->width, instance->height);
XFlush (instance->display);
frame->wait_completion = instance->xshm;
+sleep(1);
}
static int x11_alloc_frames (x11_instance_t * instance, int xshm)
Removing this line restores a high framerate.
I guess this line was added for debugging. However, it looks definitely
spurious, even with remote displays.
My patch also removes a trace, added by the same commit.
It seems that no branches or tags contain this commit.
Regards,
Lionel Debroux.
>From 70ee9502d188fcbe003476efd78500297eda5f49 Mon Sep 17 00:00:00 2001
From: Lionel Debroux <[EMAIL PROTECTED]>
Date: Sat, 22 Dec 2007 14:28:09 +0100
Subject: * Remove a spurious sleep(1); which limited the X11 output framerate to 1 FPS;
* Remove a trace.
---
trunk/libvo/video_out_x11.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/trunk/libvo/video_out_x11.c b/trunk/libvo/video_out_x11.c
index 97cb69d..319b08a 100644
--- a/trunk/libvo/video_out_x11.c
+++ b/trunk/libvo/video_out_x11.c
@@ -176,7 +176,6 @@ static int handle_error (Display * display, XErrorEvent * error)
static void * create_shm (x11_instance_t * instance, int size)
{
-fprintf(stderr, "create_shm\n");
instance->shminfo.shmid = shmget (IPC_PRIVATE, size, IPC_CREAT | 0777);
if (instance->shminfo.shmid == -1)
goto error;
@@ -275,7 +274,6 @@ static void x11_draw_frame (vo_instance_t * _instance,
instance->width, instance->height);
XFlush (instance->display);
frame->wait_completion = instance->xshm;
-sleep(1);
}
static int x11_alloc_frames (x11_instance_t * instance, int xshm)
--
1.5.3.4
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Libmpeg2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmpeg2-devel