[Toxine-cvs] CVS: toxine/src/plugins vo_aa.c,1.13,1.14 vo_dxr3.c,1.17,1.18 vo_none.c,1.10,1.11 vo_pl
Brought to you by:
f1rmb
From: Daniel Caujolle-B. <f1...@us...> - 2004-04-07 18:34:09
|
Update of /cvsroot/toxine/toxine/src/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27158/src/plugins Modified Files: vo_aa.c vo_dxr3.c vo_none.c vo_plugin.h vo_x11.c Log Message: Big Fat Note: you need very recent xine-lib (>= rc3b). Ton of fixes. xine_exit/xine_new cycle works. Update licence year. Index: vo_aa.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_aa.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- vo_aa.c 21 Jan 2003 16:53:37 -0000 1.13 +++ vo_aa.c 7 Apr 2004 18:21:07 -0000 1.14 @@ -1,5 +1,5 @@ /* -** Copyright (C) 2002-2003 Daniel Caujolle-Bert <seg...@cl...> +** Copyright (C) 2002-2004 Daniel Caujolle-Bert <seg...@cl...> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -72,22 +72,12 @@ } -static void *event_loop(void *data) { - toxine_t *tox = (toxine_t *) data; - /* toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; */ - /* aa_private_t *private = (aa_private_t *) vop->private; */ - - pthread_detach(pthread_self()); - - while(tox->video.running) - usleep(16666); - - pthread_exit(NULL); -} - static void deinit_video_out(toxine_t *tox) { toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; aa_private_t *private = (aa_private_t *) vop->private; + + xine_close_video_driver(tox->xine, tox->video.port); + tox->video.port = NULL; private->init = 0; if(private->context) { @@ -99,7 +89,7 @@ } static void release_video_out(toxine_t *tox) { - toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; + toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.last_plugin; aa_private_t *private = (aa_private_t *) vop->private; if(private->init) @@ -142,7 +132,7 @@ private->init = 0; aa->video_out_init = init_video_out; - aa->video_out_event_loop = event_loop; + aa->video_out_event_loop = NULL; aa->video_out_deinit = deinit_video_out; aa->video_out_release = release_video_out; aa->get_identifier = get_identifier; Index: vo_dxr3.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_dxr3.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- vo_dxr3.c 21 Jan 2003 16:53:37 -0000 1.17 +++ vo_dxr3.c 7 Apr 2004 18:21:07 -0000 1.18 @@ -1,5 +1,5 @@ /* -** Copyright (C) 2002-2003 Daniel Caujolle-Bert <seg...@cl...> +** Copyright (C) 2002-2004 Daniel Caujolle-Bert <seg...@cl...> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -77,26 +77,18 @@ } -static void *event_loop(void *data) { - toxine_t *tox = (toxine_t *) data; - - pthread_detach(pthread_self()); - - while(tox->video.running) - usleep(16666); - - pthread_exit(NULL); -} - static void deinit_video_out(toxine_t *tox) { toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; dxr3_private_t *private = (dxr3_private_t *) vop->private; + + xine_close_video_driver(tox->xine, tox->video.port); + tox->video.port = NULL; private->init = 0; } static void release_video_out(toxine_t *tox) { - toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; + toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.last_plugin; dxr3_private_t *private = (dxr3_private_t *) vop->private; if(private->init) @@ -142,7 +134,7 @@ private->init = 0; dxr3->video_out_init = init_video_out; - dxr3->video_out_event_loop = event_loop; + dxr3->video_out_event_loop = NULL; dxr3->video_out_deinit = deinit_video_out; dxr3->video_out_release = release_video_out; dxr3->get_identifier = get_identifier; Index: vo_none.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_none.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- vo_none.c 21 Jan 2003 16:53:38 -0000 1.10 +++ vo_none.c 7 Apr 2004 18:21:07 -0000 1.11 @@ -1,5 +1,5 @@ /* -** Copyright (C) 2002-2003 Daniel Caujolle-Bert <seg...@cl...> +** Copyright (C) 2002-2004 Daniel Caujolle-Bert <seg...@cl...> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -48,26 +48,18 @@ } -static void *event_loop(void *data) { - toxine_t *tox = (toxine_t *) data; - - pthread_detach(pthread_self()); - - while(tox->video.running) - usleep(16666); - - pthread_exit(NULL); -} - static void deinit_video_out(toxine_t *tox) { toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; none_private_t *private = (none_private_t *) vop->private; + xine_close_video_driver(tox->xine, tox->video.port); + tox->video.port = NULL; + private->init = 0; } static void release_video_out(toxine_t *tox) { - toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; + toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.last_plugin; none_private_t *private = (none_private_t *) vop->private; if(private->init) @@ -110,7 +102,7 @@ private->init = 0; none->video_out_init = init_video_out; - none->video_out_event_loop = event_loop; + none->video_out_event_loop = NULL; none->video_out_deinit = deinit_video_out; none->video_out_release = release_video_out; none->get_identifier = get_identifier; Index: vo_plugin.h =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_plugin.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- vo_plugin.h 21 Jan 2003 16:53:38 -0000 1.10 +++ vo_plugin.h 7 Apr 2004 18:21:07 -0000 1.11 @@ -1,5 +1,5 @@ /* -** Copyright (C) 2002-2003 Daniel Caujolle-Bert <seg...@cl...> +** Copyright (C) 2002-2004 Daniel Caujolle-Bert <seg...@cl...> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by Index: vo_x11.c =================================================================== RCS file: /cvsroot/toxine/toxine/src/plugins/vo_x11.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- vo_x11.c 22 May 2003 20:50:34 -0000 1.23 +++ vo_x11.c 7 Apr 2004 18:21:07 -0000 1.24 @@ -1,5 +1,5 @@ /* -** Copyright (C) 2002-2003 Daniel Caujolle-Bert <seg...@cl...> +** Copyright (C) 2002-2004 Daniel Caujolle-Bert <seg...@cl...> ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by @@ -289,32 +289,31 @@ x11_private_t *private = (x11_private_t *) vop->private; int screensaver_timer = 0; - while(!(tox->xine_state & XINE_STREAM)) - usec_sleep(100000); - while(tox->video.running) { int status; - if(tox->xine != NULL) { - status = xine_get_status(tox->stream); - - if(status == XINE_STATUS_PLAY) { - screensaver_timer++; - if(screensaver_timer >= private->fake_rate) { - screensaver_timer = 0; - reset_screensaver(vop); + if(tox->xine_state & XINE_STREAM) { + if(tox->xine != NULL) { + status = xine_get_status(tox->stream); + + if(status == XINE_STATUS_PLAY) { + screensaver_timer++; + if(screensaver_timer >= private->fake_rate) { + screensaver_timer = 0; + reset_screensaver(vop); + } } } + + if(private->cursor.visible) { + private->cursor.visible = !private->cursor.visible; + update_cursor_visibility(tox); + } + } - - if(private->cursor.visible) { - private->cursor.visible = !private->cursor.visible; - update_cursor_visibility(tox); - } - xine_usec_sleep(1000000); } - + pthread_exit(NULL); } @@ -957,21 +956,26 @@ toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; x11_private_t *private = (x11_private_t *) vop->private; XEvent myevent; - + int xconnection; + Bool got_xevent; + struct timeval tv; + fd_set r; + pthread_detach(pthread_self()); + XLockDisplay(private->display); + xconnection = ConnectionNumber(private->display); + XUnlockDisplay(private->display); + while(tox->video.running) { - Bool got_xevent; - struct timeval tv; - fd_set r; FD_ZERO(&r); - FD_SET(ConnectionNumber(private->display), &r); + FD_SET(xconnection, &r); tv.tv_sec = 0; tv.tv_usec = 33000; - select(ConnectionNumber(private->display) + 1, &r, 0, 0, &tv); + select(xconnection + 1, &r, 0, 0, &tv); XLockDisplay(private->display); got_xevent = XCheckIfEvent(private->display, &myevent, is_not_completion, (XPointer) NULL); @@ -998,7 +1002,11 @@ Status status; pthread_mutex_lock(&private->mutex); + pthread_join(private->timed_thread, NULL); + xine_close_video_driver(tox->xine, tox->video.port); + tox->video.port = NULL; + XLockDisplay(private->display); XUnmapWindow(private->display, private->x11_drawable[private->fullscreen].video_window); /* Waiting til' window's unmapped. */ @@ -1019,7 +1027,7 @@ XDestroyWindow(private->display, private->x11_drawable[private->fullscreen].video_window); XUnlockDisplay(private->display); - + XCloseDisplay(private->display); pthread_mutex_unlock(&private->mutex); @@ -1032,7 +1040,7 @@ * */ static void release_video_out(toxine_t *tox) { - toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.cur_plugin; + toxine_vo_plugin_t *vop = (toxine_vo_plugin_t *) tox->video.last_plugin; x11_private_t *private = (x11_private_t *) vop->private; if(private->init) |