summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_elem.c
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-06-07 02:40:46 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-06-07 02:40:46 +0000
commiteb4a0ced215a63478a1a941f0eecc61413eef44e (patch)
tree43490b4fc242eef9589aabc8248af5aa5854fde9 /src/demuxers/demux_elem.c
parent387d398d4c96bfe17ee38452795aeccd67e5d048 (diff)
downloadxine-lib-eb4a0ced215a63478a1a941f0eecc61413eef44e.tar.gz
xine-lib-eb4a0ced215a63478a1a941f0eecc61413eef44e.tar.bz2
- demuxer cleanup (helper functions)
- endianness fixes/cleanups (fix asf demuxer/audio for bigendian) - xine_waveformatex - increased demuxer plugin version CVS patchset: 2028 CVS date: 2002/06/07 02:40:46
Diffstat (limited to 'src/demuxers/demux_elem.c')
-rw-r--r--src/demuxers/demux_elem.c45
1 files changed, 7 insertions, 38 deletions
diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c
index 015fe655b..ad37e2a85 100644
--- a/src/demuxers/demux_elem.c
+++ b/src/demuxers/demux_elem.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_elem.c,v 1.45 2002/05/27 11:01:04 guenter Exp $
+ * $Id: demux_elem.c,v 1.46 2002/06/07 02:40:46 miguelfreitas Exp $
*
* demultiplexer for elementary mpeg streams
*
@@ -104,7 +104,6 @@ static int demux_mpeg_elem_next (demux_mpeg_elem_t *this, int preview_mode) {
*
*/
static void *demux_mpeg_elem_loop (void *this_gen) {
- buf_element_t *buf = NULL;
demux_mpeg_elem_t *this = (demux_mpeg_elem_t *) this_gen;
pthread_mutex_lock( &this->mutex );
@@ -135,17 +134,7 @@ static void *demux_mpeg_elem_loop (void *this_gen) {
this->status = DEMUX_FINISHED;
if (this->send_end_buffers) {
- buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
- buf->type = BUF_CONTROL_END;
- buf->decoder_flags = BUF_FLAG_END_STREAM; /* 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_flags = BUF_FLAG_END_STREAM; /* stream finished */
- this->audio_fifo->put (this->audio_fifo, buf);
- }
+ xine_demux_control_end(this->xine, BUF_FLAG_END_STREAM);
}
printf ("demux_elem: demux loop finished.\n");
@@ -162,7 +151,6 @@ static void *demux_mpeg_elem_loop (void *this_gen) {
static void demux_mpeg_elem_stop (demux_plugin_t *this_gen) {
demux_mpeg_elem_t *this = (demux_mpeg_elem_t *) this_gen;
- buf_element_t *buf = NULL;
void *p;
pthread_mutex_lock( &this->mutex );
@@ -179,19 +167,9 @@ static void demux_mpeg_elem_stop (demux_plugin_t *this_gen) {
pthread_mutex_unlock( &this->mutex );
pthread_join (this->thread, &p);
- xine_flush_engine(this->xine);
+ xine_demux_flush_engine(this->xine);
- buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
- buf->type = BUF_CONTROL_END;
- buf->decoder_flags = BUF_FLAG_END_USER;
- 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_flags = BUF_FLAG_END_USER;
- this->audio_fifo->put (this->audio_fifo, buf);
- }
+ xine_demux_control_end(this->xine, BUF_FLAG_END_USER);
}
/*
@@ -212,7 +190,6 @@ static int demux_mpeg_elem_start (demux_plugin_t *this_gen,
off_t start_pos, int start_time) {
demux_mpeg_elem_t *this = (demux_mpeg_elem_t *) this_gen;
- buf_element_t *buf;
int err;
int status;
@@ -228,15 +205,7 @@ static int demux_mpeg_elem_start (demux_plugin_t *this_gen,
if (!this->blocksize)
this->blocksize = 2048;
- buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
- buf->type = BUF_CONTROL_START;
- 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_START;
- this->audio_fifo->put (this->audio_fifo, buf);
- }
+ xine_demux_control_start(this->xine);
if((this->input->get_capabilities(this->input) & INPUT_CAP_PREVIEW) != 0) {
int num_buffers = NUM_PREVIEW_BUFFERS;
@@ -250,7 +219,7 @@ static int demux_mpeg_elem_start (demux_plugin_t *this_gen,
}
}
} else {
- xine_flush_engine(this->xine);
+ xine_demux_flush_engine(this->xine);
}
if((this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) != 0) {
@@ -397,7 +366,7 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) {
demux_mpeg_elem_t *this;
- if (iface != 8) {
+ if (iface != 9) {
printf ("demux_elem: plugin doesn't support plugin API version %d.\n"
" this means there's a version mismatch between xine and this "
" demuxer plugin.\nInstalling current demux plugins should help.\n",