summaryrefslogtreecommitdiff
path: root/src/demuxers
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers')
-rw-r--r--src/demuxers/demux_avi.c22
-rw-r--r--src/demuxers/demux_mpeg.c21
-rw-r--r--src/demuxers/demux_mpeg_block.c17
-rw-r--r--src/demuxers/demux_mpgaudio.c16
4 files changed, 68 insertions, 8 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index 87f42e152..1c1bfe23d 100644
--- a/src/demuxers/demux_avi.c
+++ b/src/demuxers/demux_avi.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_avi.c,v 1.17 2001/06/09 19:05:59 guenter Exp $
+ * $Id: demux_avi.c,v 1.18 2001/06/16 14:34:48 guenter Exp $
*
* demultiplexer for avi streams
*
@@ -845,8 +845,9 @@ static void *demux_avi_loop (void *this_gen) {
}
static void demux_avi_stop (demux_plugin_t *this_gen) {
- void *p;
- demux_avi_t *this = (demux_avi_t *) this_gen;
+ void *p;
+ demux_avi_t *this = (demux_avi_t *) this_gen;
+ buf_element_t *buf;
this->status = DEMUX_FINISHED;
@@ -854,6 +855,21 @@ static void demux_avi_stop (demux_plugin_t *this_gen) {
AVI_close (this->avi);
this->avi = NULL;
+
+
+ this->video_fifo->clear(this->video_fifo);
+ this->audio_fifo->clear(this->audio_fifo);
+
+ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
+ buf->type = BUF_CONTROL_END;
+ this->video_fifo->put (this->video_fifo, buf);
+
+ if(this->audio_fifo) {
+ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
+ buf->type = BUF_CONTROL_END;
+ this->audio_fifo->put (this->audio_fifo, buf);
+ }
+
}
static void demux_avi_close (demux_plugin_t *this_gen) {
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index ebda3f6d7..ab2353431 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.17 2001/06/14 10:48:24 guenter Exp $
+ * $Id: demux_mpeg.c,v 1.18 2001/06/16 14:34:48 guenter Exp $
*
* demultiplexer for mpeg 1/2 program streams
* reads streams of variable blocksizes
@@ -153,7 +153,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int nID) {
if(this->audio_fifo)
buf = this->input->read_block (this->input, this->audio_fifo, nLen-4);
else {
- buf = this->input->read (this->input, this->dummy_space, nLen);
+ this->input->read (this->input, this->dummy_space, nLen);
return;
}
@@ -375,7 +375,7 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int nID)
if(this->audio_fifo) {
buf = this->input->read_block (this->input, this->audio_fifo, nLen);
} else {
- buf = this->input->read (this->input, this->dummy_space, nLen);
+ this->input->read (this->input, this->dummy_space, nLen);
return;
}
@@ -543,10 +543,25 @@ static void *demux_mpeg_loop (void *this_gen) {
static void demux_mpeg_stop (demux_plugin_t *this_gen) {
void *p;
demux_mpeg_t *this = (demux_mpeg_t *) this_gen;
+ buf_element_t *buf;
this->status = DEMUX_FINISHED;
pthread_join (this->thread, &p);
+
+ this->video_fifo->clear(this->video_fifo);
+ this->audio_fifo->clear(this->audio_fifo);
+
+ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
+ buf->type = BUF_CONTROL_END;
+ this->video_fifo->put (this->video_fifo, buf);
+
+ if(this->audio_fifo) {
+ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
+ buf->type = BUF_CONTROL_END;
+ this->audio_fifo->put (this->audio_fifo, buf);
+ }
+
}
static int demux_mpeg_get_status (demux_plugin_t *this_gen) {
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c
index 11869a0b8..b3e7e422f 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.14 2001/06/10 13:59:33 guenter Exp $
+ * $Id: demux_mpeg_block.c,v 1.15 2001/06/16 14:34:48 guenter Exp $
*
* demultiplexer for mpeg 1/2 program streams
*
@@ -363,10 +363,25 @@ static void demux_mpeg_block_stop (demux_plugin_t *this_gen) {
demux_mpeg_block_t *this = (demux_mpeg_block_t *) this_gen;
void *p;
+ buf_element_t *buf;
this->status = DEMUX_FINISHED;
pthread_join (this->thread, &p);
+
+ this->video_fifo->clear(this->video_fifo);
+ this->audio_fifo->clear(this->audio_fifo);
+
+ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
+ buf->type = BUF_CONTROL_END;
+ this->video_fifo->put (this->video_fifo, buf);
+
+ if(this->audio_fifo) {
+ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
+ buf->type = BUF_CONTROL_END;
+ this->audio_fifo->put (this->audio_fifo, buf);
+ }
+
}
static int demux_mpeg_block_get_status (demux_plugin_t *this_gen) {
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c
index 555b381c2..f99c77ffc 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.10 2001/06/13 22:37:13 f1rmb Exp $
+ * $Id: demux_mpgaudio.c,v 1.11 2001/06/16 14:34:48 guenter Exp $
*
* demultiplexer for mpeg audio (i.e. mp3) streams
*
@@ -133,10 +133,24 @@ static void *demux_mpgaudio_loop (void *this_gen) {
static void demux_mpgaudio_stop (demux_plugin_t *this_gen) {
demux_mpgaudio_t *this = (demux_mpgaudio_t *) this_gen;
void *p;
+ buf_element_t *buf;
this->status = DEMUX_FINISHED;
pthread_join (this->thread, &p);
+
+ this->video_fifo->clear(this->video_fifo);
+ this->audio_fifo->clear(this->audio_fifo);
+
+ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
+ buf->type = BUF_CONTROL_END;
+ this->video_fifo->put (this->video_fifo, buf);
+
+ if(this->audio_fifo) {
+ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
+ buf->type = BUF_CONTROL_END;
+ this->audio_fifo->put (this->audio_fifo, buf);
+ }
}
static int demux_mpgaudio_get_status (demux_plugin_t *this_gen) {