summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_mpgaudio.c
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-06-16 18:03:21 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-06-16 18:03:21 +0000
commitaa6c019ffeaae2109b383f2a142bf2dab7c2f7b3 (patch)
tree21ca974b3613cb0d03c0bb42eb96dcacba8ffd59 /src/demuxers/demux_mpgaudio.c
parent528a7fbfe28ea118599df54bdb17b4c5f4850704 (diff)
downloadxine-lib-aa6c019ffeaae2109b383f2a142bf2dab7c2f7b3.tar.gz
xine-lib-aa6c019ffeaae2109b383f2a142bf2dab7c2f7b3.tar.bz2
xine engine cleanups and new callbacks for seamless branching
CVS patchset: 192 CVS date: 2001/06/16 18:03:21
Diffstat (limited to 'src/demuxers/demux_mpgaudio.c')
-rw-r--r--src/demuxers/demux_mpgaudio.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c
index f99c77ffc..550ffee7d 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.11 2001/06/16 14:34:48 guenter Exp $
+ * $Id: demux_mpgaudio.c,v 1.12 2001/06/16 18:03:22 guenter Exp $
*
* demultiplexer for mpeg audio (i.e. mp3) streams
*
@@ -52,6 +52,8 @@ typedef struct {
pthread_t thread;
int status;
+
+ int send_end_buffers;
} demux_mpgaudio_t ;
static uint32_t xine_debug;
@@ -106,6 +108,8 @@ static void *demux_mpgaudio_loop (void *this_gen) {
buf_element_t *buf;
demux_mpgaudio_t *this = (demux_mpgaudio_t *) this_gen;
+ this->send_end_buffers = 1;
+
do {
if (!demux_mpgaudio_next(this))
@@ -117,14 +121,18 @@ static void *demux_mpgaudio_loop (void *this_gen) {
this->status = DEMUX_FINISHED;
- 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);
+ if (this->send_end_buffers) {
+ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
+ buf->type = BUF_CONTROL_END;
+ buf->decoder_info[0] = 0; /* stream finished */
+ 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;
+ buf->decoder_info[0] = 0; /* stream finished */
+ this->audio_fifo->put (this->audio_fifo, buf);
+ }
}
pthread_exit(NULL);
@@ -135,6 +143,7 @@ static void demux_mpgaudio_stop (demux_plugin_t *this_gen) {
void *p;
buf_element_t *buf;
+ this->send_end_buffers = 0;
this->status = DEMUX_FINISHED;
pthread_join (this->thread, &p);
@@ -143,12 +152,14 @@ static void demux_mpgaudio_stop (demux_plugin_t *this_gen) {
this->audio_fifo->clear(this->audio_fifo);
buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
- buf->type = BUF_CONTROL_END;
+ buf->type = BUF_CONTROL_END;
+ buf->decoder_info[0] = 1; /* forced */
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;
+ buf->type = BUF_CONTROL_END;
+ buf->decoder_info[0] = 1; /* forced */
this->audio_fifo->put (this->audio_fifo, buf);
}
}
@@ -163,7 +174,9 @@ static void demux_mpgaudio_start (demux_plugin_t *this_gen,
fifo_buffer_t *video_fifo,
fifo_buffer_t *audio_fifo,
fifo_buffer_t *spu_fifo,
- off_t pos) {
+ off_t pos,
+ gui_get_next_mrl_cb_t next_mrl_cb,
+ gui_branched_cb_t branched_cb) {
demux_mpgaudio_t *this = (demux_mpgaudio_t *) this_gen;
buf_element_t *buf;