summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2001-08-28 22:52:57 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2001-08-28 22:52:57 +0000
commite9cae6267fe66a03633426b6283de867e6eb0b65 (patch)
tree07d32c7b2e3c36150d5fc2746fe9bf20b6ee5dab /src
parent07bc3636a8a0a1906624d7886c244e83f14b5236 (diff)
downloadxine-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
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/xine-engine/metronom.c4
-rw-r--r--src/xine-engine/xine.c65
-rw-r--r--src/xine-engine/xine_internal.h3
4 files changed, 58 insertions, 16 deletions
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;