diff options
Diffstat (limited to 'src/demuxers/demux_mpeg.c')
-rw-r--r-- | src/demuxers/demux_mpeg.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index ab2353431..b80c8f7ca 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.18 2001/06/16 14:34:48 guenter Exp $ + * $Id: demux_mpeg.c,v 1.19 2001/06/16 18:03:22 guenter Exp $ * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes @@ -61,6 +61,8 @@ typedef struct demux_mpeg_s { int status; int preview_mode; + + int send_end_buffers; } demux_mpeg_t ; static uint32_t read_bytes (demux_mpeg_t *this, int n) { @@ -511,6 +513,7 @@ static void *demux_mpeg_loop (void *this_gen) { uint32_t w; this->status = DEMUX_OK; + this->send_end_buffers = 1; do { w = parse_pack (this); @@ -520,16 +523,19 @@ static void *demux_mpeg_loop (void *this_gen) { } while (this->status == DEMUX_OK) ; - 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->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; - this->audio_fifo->put (this->audio_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); + } } - xprintf (VERBOSE|DEMUX, "demux loop finished (status: %d, buf:%x)\n", this->status, w); printf ("demux loop finished (status: %d, buf:%x)\n", @@ -545,6 +551,7 @@ static void demux_mpeg_stop (demux_plugin_t *this_gen) { demux_mpeg_t *this = (demux_mpeg_t *) this_gen; buf_element_t *buf; + this->send_end_buffers = 0; this->status = DEMUX_FINISHED; pthread_join (this->thread, &p); @@ -553,15 +560,16 @@ static void demux_mpeg_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); } - } static int demux_mpeg_get_status (demux_plugin_t *this_gen) { @@ -573,7 +581,9 @@ static void demux_mpeg_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_mpeg_t *this = (demux_mpeg_t *) this_gen; buf_element_t *buf; |