summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/xine.c48
-rw-r--r--src/xine-engine/xine_internal.h15
2 files changed, 54 insertions, 9 deletions
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 42c7713c0..f2f3b67cd 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.42 2001/08/16 19:58:37 ehasenle Exp $
+ * $Id: xine.c,v 1.43 2001/08/17 16:15:37 f1rmb Exp $
*
* top-level xine functions
*
@@ -82,14 +82,13 @@ void xine_stop (xine_t *this) {
return;
}
- this->status = XINE_STOP;
printf ("xine_stop: stopping demuxer\n");
-
+
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) {
@@ -101,7 +100,9 @@ void xine_stop (xine_t *this) {
* this->cur_input_plugin = NULL;
*/
}
-
+
+ this->status = XINE_STOP;
+
printf ("xine_stop: done\n");
pthread_mutex_unlock (&this->xine_lock);
@@ -263,15 +264,49 @@ void xine_play (xine_t *this, char *MRL, int spos) {
pthread_mutex_unlock (&this->xine_lock);
xine_pause(this);
return;
+ break;
+
case XINE_STOP:
xine_play_internal (this, MRL, spos, (off_t) 0);
break;
+
default:
printf ("xine_play: error, xine is not paused/stopped\n");
}
pthread_mutex_unlock (&this->xine_lock);
}
+void xine_seek (xine_t *this, char *MRL, int spos) {
+
+ pthread_mutex_lock (&this->xine_lock);
+
+ printf ("xine_seek\n");
+
+ switch (this->status) {
+ case XINE_PLAY:
+ case XINE_STOP:
+ case XINE_PAUSE:
+ this->status = XINE_SEEK;
+
+ if(this->cur_demuxer_plugin) {
+ this->cur_demuxer_plugin->stop (this->cur_demuxer_plugin);
+ }
+
+ if(this->cur_input_plugin) {
+ this->cur_input_plugin->stop(this->cur_input_plugin);
+ }
+
+ this->status = XINE_STOP;
+ xine_play_internal (this, MRL, spos, (off_t)0);
+ break;
+
+ default:
+ printf ("xine_play: error, unhandled status %d\n", this->status);
+ }
+
+ pthread_mutex_unlock (&this->xine_lock);
+}
+
int xine_eject (xine_t *this) {
if(this->cur_input_plugin == NULL)
@@ -345,7 +380,6 @@ void xine_pause (xine_t *this) {
this->cur_mrl, this->cur_input_pos);
this->status = XINE_STOP;
-
xine_play_internal (this, this->cur_mrl, 0, this->cur_input_pos);
/* this->mnPausePos = 0; */
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 0833438c5..13fc9803b 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.37 2001/08/13 12:52:33 ehasenle Exp $
+ * $Id: xine_internal.h,v 1.38 2001/08/17 16:15:37 f1rmb Exp $
*
*/
@@ -120,7 +120,8 @@ typedef void (*gui_stream_end_cb_t)(int nStatus);
#define XINE_STOP 0
#define XINE_PLAY 1
#define XINE_PAUSE 2
-#define XINE_QUIT 3
+#define XINE_SEEK 3
+#define XINE_QUIT 4
typedef struct xine_s xine_t;
@@ -218,6 +219,16 @@ void xine_play (xine_t *this, char *MRL, int pos);
/*
+ * seek the stream to pos, and play it
+ *
+ * name : mrl to open
+ * pos : start position 0..65535
+ *
+ */
+void xine_seek (xine_t *this, char *MRL, int pos);
+
+
+/*
* toggle pause mode
*/
void xine_pause (xine_t *this);