diff options
author | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2001-08-28 22:52:57 +0000 |
---|---|---|
committer | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2001-08-28 22:52:57 +0000 |
commit | e9cae6267fe66a03633426b6283de867e6eb0b65 (patch) | |
tree | 07d32c7b2e3c36150d5fc2746fe9bf20b6ee5dab | |
parent | 07bc3636a8a0a1906624d7886c244e83f14b5236 (diff) | |
download | xine-lib-e9cae6267fe66a03633426b6283de867e6eb0b65.tar.gz xine-lib-e9cae6267fe66a03633426b6283de867e6eb0b65.tar.bz2 |
Fixed sed pattern. Reintroduce XINE_PAUSE status. Fixed deadlock in xine_pause. Fixed
many pause/unpause case. Syncing xine.h.tmpl.in with xine_internal.h about
status (Please, don't forget to update the public API header, that made
troubles).
CVS patchset: 513
CVS date: 2001/08/28 22:52:57
-rw-r--r-- | configure.in | 26 | ||||
-rw-r--r-- | include/xine.h.tmpl.in | 18 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/xine-engine/metronom.c | 4 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 65 | ||||
-rw-r--r-- | src/xine-engine/xine_internal.h | 3 |
6 files changed, 77 insertions, 41 deletions
diff --git a/configure.in b/configure.in index 321c3abf6..ad82a3053 100644 --- a/configure.in +++ b/configure.in @@ -581,19 +581,19 @@ dnl dnl Get where .m4 should be installed. dnl case "`id`" in -uid=0\(* ) - AC_MSG_CHECKING(for aclocal directory) - if(aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL_DIR=`$ACLOCAL --print-ac-dir` - AC_MSG_RESULT($ACLOCAL_DIR) - else - ACLOCAL_DIR="/usr/local/share/aclocal" - AC_MSG_RESULT(none - will be installed in $ACLOCAL_DIR) - fi - escapedprefix=`echo "$prefix"|sed -e 's/\//\/\//g'` - ACLOCAL_DIR=`echo "$ACLOCAL_DIR"|sed -e s/^"$escapedprefix"/'\${prefix}'/` - AC_SUBST(ACLOCAL_DIR) - ;; + uid=0\(* ) + AC_MSG_CHECKING(for aclocal directory) + if(aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL_DIR=`$ACLOCAL --print-ac-dir` + AC_MSG_RESULT($ACLOCAL_DIR) + else + ACLOCAL_DIR="/usr/local/share/aclocal" + AC_MSG_RESULT(none - will be installed in $ACLOCAL_DIR) + fi + escapedprefix="`echo $prefix | sed -e 's/\\//\\\\\//g'`" + ACLOCAL_DIR="`echo $ACLOCAL_DIR|sed -e s/^$escapedprefix/'\${prefix}'/`" + AC_SUBST(ACLOCAL_DIR) + ;; esac AM_CONDITIONAL(INSTALL_M4, test x"$ACLOCAL_DIR" != "x") diff --git a/include/xine.h.tmpl.in b/include/xine.h.tmpl.in index aa5dba72c..a009b9c89 100644 --- a/include/xine.h.tmpl.in +++ b/include/xine.h.tmpl.in @@ -28,7 +28,7 @@ \endverbatim */ /* - * $Id: xine.h.tmpl.in,v 1.38 2001/08/25 08:50:11 guenter Exp $ + * $Id: xine.h.tmpl.in,v 1.39 2001/08/28 22:52:57 f1rmb Exp $ * */ @@ -100,24 +100,18 @@ extern "C" { * \sa xine_get_status() */ #define XINE_PLAY 1 -/** - * \def XINE_PAUSE - * Pause status. - * \sa xine_get_status() - */ -#define XINE_PAUSE 2 /** * \def XINE_QUIT * Quit status. * \sa xine_get_status() */ -#define XINE_SEEK 3 -/** - * \def XINE_QUIT - * Quit status. +#define XINE_QUIT 2 +/** + * \def XINE_PAUSE + * Pause status. * \sa xine_get_status() */ -#define XINE_QUIT 4 +#define XINE_PAUSE 3 /** @} end of status_group */ diff --git a/src/Makefile.am b/src/Makefile.am index f22f2a189..d96543a0a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = audio_out video_out dxr3 input libmpeg2 libspudec demuxers \ - libac3 libffmpeg liblpcm libw32dll xine-engine libmad + libac3 libffmpeg liblpcm libw32dll libmad xine-engine debug: @list='$(SUBDIRS)'; for subdir in $$list; do \ diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 6a872e5aa..bfe3d5393 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: metronom.c,v 1.22 2001/08/26 09:38:23 jcdutton Exp $ + * $Id: metronom.c,v 1.23 2001/08/28 22:52:57 f1rmb Exp $ */ #ifdef HAVE_CONFIG_H @@ -340,8 +340,8 @@ static void metronom_audio_stream_end (metronom_t *this) { } this->audio_stream_running = 0; + while (this->video_stream_running) { - printf ("waiting for video to end...\n"); pthread_cond_wait (&this->video_ended, &this->lock); } diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 37a844190..9bdf6bd1c 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine.c,v 1.50 2001/08/25 14:56:19 guenter Exp $ + * $Id: xine.c,v 1.51 2001/08/28 22:52:57 f1rmb Exp $ * * top-level xine functions * @@ -75,6 +75,11 @@ void xine_stop (xine_t *this) { pthread_mutex_unlock (&this->xine_lock); return; } + else if(this->status == XINE_PAUSE) { + this->metronom->set_speed (this->metronom, SPEED_NORMAL); + this->paused = 0; + this->audio_mute = 0; + } this->status = XINE_STOP; printf ("xine_stop: stopping demuxer\n"); @@ -250,20 +255,41 @@ static void xine_play_internal (xine_t *this, char *mrl, } void xine_play (xine_t *this, char *MRL, int spos) { - + pthread_mutex_lock (&this->xine_lock); + + if(this->status == XINE_PAUSE) { - if (this->status != XINE_STOP) { - + this->metronom->set_speed (this->metronom, SPEED_NORMAL); + this->paused = 0; + this->audio_mute = 0; + + if(this->cur_demuxer_plugin) { + this->cur_demuxer_plugin->stop (this->cur_demuxer_plugin); + this->cur_demuxer_plugin->close (this->cur_demuxer_plugin); + this->cur_demuxer_plugin = NULL; + } + + printf ("xine_stop: closing input\n"); + + if(this->cur_input_plugin) { + this->cur_input_plugin->close(this->cur_input_plugin); + } + + this->status = XINE_STOP; + + } + else if (this->status != XINE_STOP) { + this->metronom->set_speed (this->metronom, SPEED_NORMAL); this->audio_mute = 0; pthread_mutex_unlock (&this->xine_lock); return; } - + xine_play_internal (this, MRL, spos, (off_t) 0); - + pthread_mutex_unlock (&this->xine_lock); } @@ -273,7 +299,13 @@ void xine_seek (xine_t *this, char *mrl, int pos) { printf ("xine_seek\n"); - if (this->status == XINE_PLAY) { + if (this->status == XINE_PLAY || this->status == XINE_PAUSE) { + + if(this->status == XINE_PAUSE) { + this->metronom->set_speed (this->metronom, SPEED_NORMAL); + this->paused = 0; + this->audio_mute = 0; + } if(this->cur_demuxer_plugin) { this->cur_demuxer_plugin->stop (this->cur_demuxer_plugin); @@ -315,21 +347,29 @@ void xine_exit (xine_t *this) { printf ("xine_exit: try to get lock...\n"); pthread_mutex_lock (&this->xine_lock); - + + if(this->status == XINE_PAUSE) { + this->metronom->set_speed (this->metronom, SPEED_NORMAL); + this->paused = 0; + this->status = XINE_STOP; + } + /* * stop decoder threads */ if(this->cur_demuxer_plugin) { - printf ("xine_exit: stopping demuxer\n"); + printf ("xine_exit: closing demuxer\n"); this->cur_demuxer_plugin->stop (this->cur_demuxer_plugin); + this->cur_demuxer_plugin->close (this->cur_demuxer_plugin); this->cur_demuxer_plugin = NULL; } if(this->cur_input_plugin) { printf ("xine_exit: closing input plugin\n"); + this->cur_input_plugin->stop (this->cur_input_plugin); this->cur_input_plugin->close(this->cur_input_plugin); this->cur_input_plugin = NULL; } @@ -359,24 +399,25 @@ void xine_pause (xine_t *this) { printf ("xine_pause\n"); - if (this->status != XINE_PLAY) { + if (this->status != XINE_PLAY && this->status != XINE_PAUSE ) { printf ("xine: error, pause called when not in playback mode\n"); - + pthread_mutex_unlock (&this->xine_lock); return; } - if (this->paused) { this->metronom->set_speed (this->metronom, SPEED_NORMAL); this->audio_mute = 0; this->paused = 0; + this->status = XINE_PLAY; } else { this->metronom->set_speed (this->metronom, SPEED_PAUSE); this->paused = 1; this->audio_mute = 2; + this->status = XINE_PAUSE; } diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index d8727e172..56290bb79 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_internal.h,v 1.41 2001/08/25 07:12:16 guenter Exp $ + * $Id: xine_internal.h,v 1.42 2001/08/28 22:52:57 f1rmb Exp $ * */ @@ -120,6 +120,7 @@ typedef void (*gui_stream_end_cb_t)(int nStatus); #define XINE_STOP 0 #define XINE_PLAY 1 #define XINE_QUIT 2 +#define XINE_PAUSE 3 typedef struct xine_s xine_t; |