summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibaut Mattern <tmattern@users.sourceforge.net>2002-05-21 00:17:54 +0000
committerThibaut Mattern <tmattern@users.sourceforge.net>2002-05-21 00:17:54 +0000
commit8f69eeec9ea8a11767fa320f5540989f8459b44b (patch)
treef44c8cf1991fdc22ac5885223f7af4046f461d56
parent3356ed2344e21f913e9a49d631d0c1c714e87aa7 (diff)
downloadxine-lib-8f69eeec9ea8a11767fa320f5540989f8459b44b.tar.gz
xine-lib-8f69eeec9ea8a11767fa320f5540989f8459b44b.tar.bz2
start() and seek() return the status
CVS patchset: 1916 CVS date: 2002/05/21 00:17:54
-rw-r--r--src/demuxers/demux_cda.c15
-rw-r--r--src/demuxers/demux_mpeg.c16
-rw-r--r--src/demuxers/demux_mpeg_block.c15
-rw-r--r--src/demuxers/demux_mpgaudio.c14
-rw-r--r--src/demuxers/demux_pes.c16
-rw-r--r--src/demuxers/demux_qt.c22
-rw-r--r--src/demuxers/demux_ts.c15
7 files changed, 80 insertions, 33 deletions
diff --git a/src/demuxers/demux_cda.c b/src/demuxers/demux_cda.c
index f0bff2e1a..308fd9a73 100644
--- a/src/demuxers/demux_cda.c
+++ b/src/demuxers/demux_cda.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: demux_cda.c,v 1.15 2002/05/15 22:50:59 tmattern Exp $
+ * $Id: demux_cda.c,v 1.16 2002/05/21 00:17:54 tmattern Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -192,13 +192,14 @@ static int demux_cda_get_status (demux_plugin_t *this_gen) {
/*
*
*/
-static void demux_cda_start (demux_plugin_t *this_gen,
+static int demux_cda_start (demux_plugin_t *this_gen,
fifo_buffer_t *video_fifo,
fifo_buffer_t *audio_fifo,
off_t start_pos, int start_time) {
demux_cda_t *this = (demux_cda_t *) this_gen;
buf_element_t *buf;
int err;
+ int status;
pthread_mutex_lock( &this->mutex );
@@ -237,15 +238,21 @@ static void demux_cda_start (demux_plugin_t *this_gen,
abort();
}
}
+
+ /* this->status is saved because we can be interrupted between
+ * pthread_mutex_unlock and return
+ */
+ status = this->status;
pthread_mutex_unlock( &this->mutex );
+ return status;
}
-static void demux_cda_seek (demux_plugin_t *this_gen,
+static int demux_cda_seek (demux_plugin_t *this_gen,
off_t start_pos, int start_time) {
demux_cda_t *this = (demux_cda_t *) this_gen;
- demux_cda_start (this_gen, this->video_fifo, this->audio_fifo,
+ return demux_cda_start (this_gen, this->video_fifo, this->audio_fifo,
start_pos, start_time);
}
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index 97f62c289..06ef78883 100644
--- a/src/demuxers/demux_mpeg.c
+++ b/src/demuxers/demux_mpeg.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: demux_mpeg.c,v 1.61 2002/05/12 12:06:29 tmattern Exp $
+ * $Id: demux_mpeg.c,v 1.62 2002/05/21 00:17:55 tmattern Exp $
*
* demultiplexer for mpeg 1/2 program streams
* reads streams of variable blocksizes
@@ -764,7 +764,7 @@ static int demux_mpeg_get_status (demux_plugin_t *this_gen) {
return (this->thread_running?DEMUX_OK:DEMUX_FINISHED);
}
-static void demux_mpeg_start (demux_plugin_t *this_gen,
+static int demux_mpeg_start (demux_plugin_t *this_gen,
fifo_buffer_t *video_fifo,
fifo_buffer_t *audio_fifo,
off_t start_pos, int start_time) {
@@ -772,6 +772,7 @@ static void demux_mpeg_start (demux_plugin_t *this_gen,
demux_mpeg_t *this = (demux_mpeg_t *) this_gen;
buf_element_t *buf;
int err;
+ int status;
pthread_mutex_lock( &this->mutex );
@@ -851,15 +852,20 @@ static void demux_mpeg_start (demux_plugin_t *this_gen,
else {
xine_flush_engine(this->xine);
}
- pthread_mutex_unlock( &this->mutex );
+ /* this->status is saved because we can be interrupted between
+ * pthread_mutex_unlock and return
+ */
+ status = this->status;
+ pthread_mutex_unlock( &this->mutex );
+ return status;
}
-static void demux_mpeg_seek (demux_plugin_t *this_gen,
+static int demux_mpeg_seek (demux_plugin_t *this_gen,
off_t start_pos, int start_time) {
demux_mpeg_t *this = (demux_mpeg_t *) this_gen;
- demux_mpeg_start (this_gen, this->video_fifo, this->audio_fifo,
+ return demux_mpeg_start (this_gen, this->video_fifo, this->audio_fifo,
start_pos, start_time);
}
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c
index e1de03b33..b188dbde9 100644
--- a/src/demuxers/demux_mpeg_block.c
+++ b/src/demuxers/demux_mpeg_block.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: demux_mpeg_block.c,v 1.100 2002/05/14 22:22:43 tmattern Exp $
+ * $Id: demux_mpeg_block.c,v 1.101 2002/05/21 00:17:55 tmattern Exp $
*
* demultiplexer for mpeg 1/2 program streams
*
@@ -933,7 +933,7 @@ static int demux_mpeg_detect_blocksize(demux_mpeg_block_t *this,
}
-static void demux_mpeg_block_start (demux_plugin_t *this_gen,
+static int demux_mpeg_block_start (demux_plugin_t *this_gen,
fifo_buffer_t *video_fifo,
fifo_buffer_t *audio_fifo,
off_t start_pos, int start_time) {
@@ -941,6 +941,7 @@ static void demux_mpeg_block_start (demux_plugin_t *this_gen,
demux_mpeg_block_t *this = (demux_mpeg_block_t *) this_gen;
buf_element_t *buf;
int err;
+ int status;
pthread_mutex_lock( &this->mutex );
@@ -1052,14 +1053,20 @@ static void demux_mpeg_block_start (demux_plugin_t *this_gen,
_("demux_mpeg_block: unknown block size. try using demux_mpeg.\n"));
this->status = DEMUX_FINISHED ;
}
+
+ /* this->status is saved because we can be interrupted between
+ * pthread_mutex_unlock and return
+ */
+ status = this->status;
pthread_mutex_unlock( &this->mutex );
+ return status;
}
-static void demux_mpeg_block_seek (demux_plugin_t *this_gen,
+static int demux_mpeg_block_seek (demux_plugin_t *this_gen,
off_t start_pos, int start_time) {
demux_mpeg_block_t *this = (demux_mpeg_block_t *) this_gen;
- demux_mpeg_block_start (this_gen, this->video_fifo, this->audio_fifo,
+ return demux_mpeg_block_start (this_gen, this->video_fifo, this->audio_fifo,
start_pos, start_time);
}
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c
index e9931705a..838563e4d 100644
--- a/src/demuxers/demux_mpgaudio.c
+++ b/src/demuxers/demux_mpgaudio.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: demux_mpgaudio.c,v 1.44 2002/05/19 16:21:04 tmattern Exp $
+ * $Id: demux_mpgaudio.c,v 1.45 2002/05/21 00:17:57 tmattern Exp $
*
* demultiplexer for mpeg audio (i.e. mp3) streams
*
@@ -383,7 +383,7 @@ static uint32_t demux_mpgaudio_read_head(input_plugin_t *input)
return head;
}
-static void demux_mpgaudio_start (demux_plugin_t *this_gen,
+static int demux_mpgaudio_start (demux_plugin_t *this_gen,
fifo_buffer_t *video_fifo,
fifo_buffer_t *audio_fifo,
off_t start_pos, int start_time) {
@@ -391,6 +391,7 @@ static void demux_mpgaudio_start (demux_plugin_t *this_gen,
demux_mpgaudio_t *this = (demux_mpgaudio_t *) this_gen;
buf_element_t *buf;
int err;
+ int status;
pthread_mutex_lock( &this->mutex );
@@ -450,14 +451,19 @@ static void demux_mpgaudio_start (demux_plugin_t *this_gen,
else {
xine_flush_engine(this->xine);
}
+ /* this->status is saved because we can be interrupted between
+ * pthread_mutex_unlock and return
+ */
+ status = this->status;
pthread_mutex_unlock( &this->mutex );
+ return status;
}
-static void demux_mpgaudio_seek (demux_plugin_t *this_gen,
+static int demux_mpgaudio_seek (demux_plugin_t *this_gen,
off_t start_pos, int start_time) {
demux_mpgaudio_t *this = (demux_mpgaudio_t *) this_gen;
- demux_mpgaudio_start (this_gen, this->video_fifo, this->audio_fifo,
+ return demux_mpgaudio_start (this_gen, this->video_fifo, this->audio_fifo,
start_pos, start_time);
}
diff --git a/src/demuxers/demux_pes.c b/src/demuxers/demux_pes.c
index dee626090..43f05203c 100644
--- a/src/demuxers/demux_pes.c
+++ b/src/demuxers/demux_pes.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: demux_pes.c,v 1.27 2002/05/17 22:05:49 miguelfreitas Exp $
+ * $Id: demux_pes.c,v 1.28 2002/05/21 00:17:56 tmattern Exp $
*
* demultiplexer for mpeg 2 PES (Packetized Elementary Streams)
* reads streams of variable blocksizes
@@ -425,7 +425,7 @@ static int demux_pes_get_status (demux_plugin_t *this_gen) {
return (this->thread_running?DEMUX_OK:DEMUX_FINISHED);
}
-static void demux_pes_start (demux_plugin_t *this_gen,
+static int demux_pes_start (demux_plugin_t *this_gen,
fifo_buffer_t *video_fifo,
fifo_buffer_t *audio_fifo,
off_t start_pos, int start_time) {
@@ -433,6 +433,7 @@ static void demux_pes_start (demux_plugin_t *this_gen,
demux_pes_t *this = (demux_pes_t *) this_gen;
buf_element_t *buf;
int err;
+ int status;
pthread_mutex_lock( &this->mutex );
@@ -507,15 +508,20 @@ static void demux_pes_start (demux_plugin_t *this_gen,
else {
xine_flush_engine(this->xine);
}
- pthread_mutex_unlock( &this->mutex );
+ /* this->status is saved because we can be interrupted between
+ * pthread_mutex_unlock and return
+ */
+ status = this->status;
+ pthread_mutex_unlock( &this->mutex );
+ return status;
}
-static void demux_pes_seek (demux_plugin_t *this_gen,
+static int demux_pes_seek (demux_plugin_t *this_gen,
off_t start_pos, int start_time) {
demux_pes_t *this = (demux_pes_t *) this_gen;
- demux_pes_start (this_gen, this->video_fifo, this->audio_fifo,
+ return demux_pes_start (this_gen, this->video_fifo, this->audio_fifo,
start_pos, start_time);
}
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index 46e2dce82..872c640db 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.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: demux_qt.c,v 1.31 2002/05/20 16:58:02 miguelfreitas Exp $
+ * $Id: demux_qt.c,v 1.32 2002/05/21 00:17:55 tmattern Exp $
*
* demultiplexer for mpeg-4 system (aka quicktime) streams, based on:
*
@@ -4203,7 +4203,7 @@ static void demux_qt_create_index (demux_qt_t *this) {
printf ("demux_qt: index generation done.\n");
}
-static void demux_qt_start (demux_plugin_t *this_gen,
+static int demux_qt_start (demux_plugin_t *this_gen,
fifo_buffer_t *video_fifo,
fifo_buffer_t *audio_fifo,
off_t start_pos, int start_time) {
@@ -4211,6 +4211,7 @@ static void demux_qt_start (demux_plugin_t *this_gen,
demux_qt_t *this = (demux_qt_t *) this_gen;
buf_element_t *buf;
int err;
+ int status;
pthread_mutex_lock( &this->mutex );
@@ -4230,14 +4231,16 @@ static void demux_qt_start (demux_plugin_t *this_gen,
if (!this->qt) {
this->status = DEMUX_FINISHED;
+ status = this->status;
pthread_mutex_unlock( &this->mutex );
- return;
+ return status;
}
if (!demux_qt_detect_compressors (this)) {
this->status = DEMUX_FINISHED;
+ status = this->status;
pthread_mutex_unlock( &this->mutex );
- return;
+ return status;
}
xine_log (this->xine, XINE_LOG_FORMAT,
@@ -4334,15 +4337,20 @@ static void demux_qt_start (demux_plugin_t *this_gen,
else {
xine_flush_engine(this->xine);
}
- pthread_mutex_unlock( &this->mutex );
+ /* this->status is saved because we can be interrupted between
+ * pthread_mutex_unlock and return
+ */
+ status = this->status;
+ pthread_mutex_unlock( &this->mutex );
+ return status;
}
-static void demux_qt_seek (demux_plugin_t *this_gen,
+static int demux_qt_seek (demux_plugin_t *this_gen,
off_t start_pos, int start_time) {
demux_qt_t *this = (demux_qt_t *) this_gen;
- demux_qt_start (this_gen, this->video_fifo, this->audio_fifo,
+ return demux_qt_start (this_gen, this->video_fifo, this->audio_fifo,
start_pos, start_time);
}
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index d2f54bd5f..bc614bf06 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.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: demux_ts.c,v 1.44 2002/05/17 21:24:10 miguelfreitas Exp $
+ * $Id: demux_ts.c,v 1.45 2002/05/21 00:17:57 tmattern Exp $
*
* Demultiplexer for MPEG2 Transport Streams.
*
@@ -1360,7 +1360,7 @@ static int demux_ts_open(demux_plugin_t *this_gen, input_plugin_t *input,
return DEMUX_CAN_HANDLE;
}
-static void demux_ts_start(demux_plugin_t *this_gen,
+static int demux_ts_start(demux_plugin_t *this_gen,
fifo_buffer_t *video_fifo,
fifo_buffer_t *audio_fifo,
off_t start_pos, int start_time) {
@@ -1368,6 +1368,7 @@ static void demux_ts_start(demux_plugin_t *this_gen,
demux_ts *this = (demux_ts *)this_gen;
buf_element_t *buf;
int err;
+ int status;
pthread_mutex_lock( &this->mutex );
@@ -1420,14 +1421,20 @@ static void demux_ts_start(demux_plugin_t *this_gen,
else {
xine_flush_engine(this->xine);
}
+
+ /* this->status is saved because we can be interrupted between
+ * pthread_mutex_unlock and return
+ */
+ status = this->status;
pthread_mutex_unlock( &this->mutex );
+ return status;
}
-static void demux_ts_seek (demux_plugin_t *this_gen,
+static int demux_ts_seek (demux_plugin_t *this_gen,
off_t start_pos, int start_time) {
demux_ts *this = (demux_ts *)this_gen;
- demux_ts_start (this_gen, this->video_fifo, this->audio_fifo,
+ return demux_ts_start (this_gen, this->video_fifo, this->audio_fifo,
start_pos, start_time);
}