diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2004-11-13 17:18:15 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2004-11-13 17:18:15 +0000 |
commit | c6a1bafda333d15e7b5559cc085200a3c930a13c (patch) | |
tree | 4215df50df4fceaf8f246bd1a2f5e8c933737ea6 | |
parent | ff14287849c1d7168bea4602d52806dffe54398c (diff) | |
download | xine-lib-c6a1bafda333d15e7b5559cc085200a3c930a13c.tar.gz xine-lib-c6a1bafda333d15e7b5559cc085200a3c930a13c.tar.bz2 |
xinimin updates to properly quit on stream end
CVS patchset: 7121
CVS date: 2004/11/13 17:18:15
-rw-r--r-- | doc/hackersguide/library.sgml | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/doc/hackersguide/library.sgml b/doc/hackersguide/library.sgml index 69570fcc3..07aaf3cc0 100644 --- a/doc/hackersguide/library.sgml +++ b/doc/hackersguide/library.sgml @@ -69,7 +69,7 @@ */ /* - * compile-command: "gcc -Wall -O2 `xine-config --cflags` `xine-config --libs` -lX11 -lm -o xinimin xinimin.c" + * compile-command: "gcc -Wall -O2 `xine-config --cflags` `xine-config --libs` -L/usr/X11R6/lib -lX11 -lm -o xinimin xinimin.c" */ #include <stdio.h> @@ -112,6 +112,9 @@ static double pixel_aspect; static int running = 1; +#define INPUT_MOTION (ExposureMask | ButtonPressMask | KeyPressMask | \ + ButtonMotionMask | StructureNotifyMask | \ + PropertyChangeMask | PointerMotionMask) /* this will be called by xine, if it wants to know the target size of a frame */ static void dest_size_cb(void *data, int video_width, int video_height, double video_pixel_aspect, @@ -210,13 +213,9 @@ int main(int argc, char **argv) { 0, 0, (DisplayWidth(display, screen)), (DisplayHeight(display, screen)), 0, 0, 0); - XSelectInput(display, window[0], (ExposureMask | ButtonPressMask | KeyPressMask | - ButtonMotionMask | StructureNotifyMask | - PropertyChangeMask | PointerMotionMask)); + XSelectInput(display, window[0], INPUT_MOTION); - XSelectInput(display, window[1], (ExposureMask | ButtonPressMask | KeyPressMask | - ButtonMotionMask | StructureNotifyMask | - PropertyChangeMask | PointerMotionMask)); + XSelectInput(display, window[1], INPUT_MOTION); XA_NO_BORDER = XInternAtom(display, "_MOTIF_WM_HINTS", False); mwmhints.flags = MWM_HINTS_DECORATIONS; @@ -262,9 +261,17 @@ int main(int argc, char **argv) { } while (running) { - XEvent xevent; + XEvent xevent; + int got_event; + + xine_usec_sleep(20000); + + XLockDisplay(display); + got_event = XCheckMaskEvent(display, INPUT_MOTION, &xevent); + XUnlockDisplay(display); - XNextEvent(display, &xevent); + if( !got_event ) + continue; switch(xevent.type) { |