diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-06-07 02:40:46 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-06-07 02:40:46 +0000 |
commit | eb4a0ced215a63478a1a941f0eecc61413eef44e (patch) | |
tree | 43490b4fc242eef9589aabc8248af5aa5854fde9 /src/demuxers/demux_mpgaudio.c | |
parent | 387d398d4c96bfe17ee38452795aeccd67e5d048 (diff) | |
download | xine-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_mpgaudio.c')
-rw-r--r-- | src/demuxers/demux_mpgaudio.c | 59 |
1 files changed, 8 insertions, 51 deletions
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index 755e92dbf..14cb93460 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.48 2002/05/27 11:01:04 guenter Exp $ + * $Id: demux_mpgaudio.c,v 1.49 2002/06/07 02:40:47 miguelfreitas Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -194,19 +194,7 @@ static void check_newpts( demux_mpgaudio_t *this, int64_t pts ) if( pts && (this->send_newpts || (this->last_pts && abs(diff)>WRAP_THRESHOLD) ) ) { - buf_element_t *buf; - - buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); - buf->type = BUF_CONTROL_NEWPTS; - buf->disc_off = pts; - 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_NEWPTS; - buf->disc_off = pts; - this->audio_fifo->put (this->audio_fifo, buf); - } + xine_demux_control_newpts(this->xine, pts, 0); this->send_newpts = 0; } @@ -266,7 +254,6 @@ static int demux_mpgaudio_next (demux_mpgaudio_t *this) { } static void *demux_mpgaudio_loop (void *this_gen) { - buf_element_t *buf; demux_mpgaudio_t *this = (demux_mpgaudio_t *) this_gen; pthread_mutex_lock( &this->mutex ); @@ -297,17 +284,7 @@ static void *demux_mpgaudio_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; - 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; - this->audio_fifo->put (this->audio_fifo, buf); - } + xine_demux_control_end(this->xine, BUF_FLAG_END_STREAM); } printf ("demux_mpgaudio: demux loop finished.\n"); @@ -321,7 +298,6 @@ 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; - buf_element_t *buf; void *p; pthread_mutex_lock( &this->mutex ); @@ -338,19 +314,9 @@ static void demux_mpgaudio_stop (demux_plugin_t *this_gen) { pthread_mutex_unlock( &this->mutex ); pthread_join (this->thread, &p); - xine_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); + xine_demux_flush_engine(this->xine); - 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); } static int demux_mpgaudio_get_status (demux_plugin_t *this_gen) { @@ -389,7 +355,6 @@ static int demux_mpgaudio_start (demux_plugin_t *this_gen, off_t start_pos, int start_time) { demux_mpgaudio_t *this = (demux_mpgaudio_t *) this_gen; - buf_element_t *buf; int err; int status; @@ -431,15 +396,7 @@ static int demux_mpgaudio_start (demux_plugin_t *this_gen, this->send_newpts = 1; if( !this->thread_running ) { - 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); /* * now start demuxing @@ -455,7 +412,7 @@ static int demux_mpgaudio_start (demux_plugin_t *this_gen, } } else { - xine_flush_engine(this->xine); + xine_demux_flush_engine(this->xine); } /* this->status is saved because we can be interrupted between * pthread_mutex_unlock and return @@ -564,7 +521,7 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) { demux_mpgaudio_t *this; - if (iface != 8) { + if (iface != 9) { printf ("demux_mpeg: 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", |