diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2001-11-07 19:06:15 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2001-11-07 19:06:15 +0000 |
commit | c053feafaf72f6dc4b6e159c0bd206820e839b7f (patch) | |
tree | 4067d752ab094892d32c63c1c6d7a169f150f432 /src/demuxers | |
parent | b9863e2de7c47a70764f16eb9c00f0bea8a6a602 (diff) | |
download | xine-lib-c053feafaf72f6dc4b6e159c0bd206820e839b7f.tar.gz xine-lib-c053feafaf72f6dc4b6e159c0bd206820e839b7f.tar.bz2 |
buf types cleanup (audio stuff)
CVS patchset: 989
CVS date: 2001/11/07 19:06:15
Diffstat (limited to 'src/demuxers')
-rw-r--r-- | src/demuxers/demux_asf.c | 41 | ||||
-rw-r--r-- | src/demuxers/demux_avi.c | 39 |
2 files changed, 19 insertions, 61 deletions
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 0ec0e1acb..b2da7551b 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.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_asf.c,v 1.7 2001/11/07 18:26:36 miguelfreitas Exp $ + * $Id: demux_asf.c,v 1.8 2001/11/07 19:06:15 miguelfreitas Exp $ * * demultiplexer for asf streams * @@ -295,40 +295,17 @@ static void asf_send_audio_header (demux_asf_t *this, int stream_id) { if (!this->audio_fifo) return; - switch (wavex->wFormatTag) { - case 0x01: - this->streams[this->num_streams].buf_type = BUF_AUDIO_LPCM_LE; - break; - case 0x2000: - this->streams[this->num_streams].buf_type = BUF_AUDIO_A52; - break; - case 0x50: - case 0x55: - this->streams[this->num_streams].buf_type = BUF_AUDIO_MPEG; - break; - case 0x160: - case 0x161: - this->streams[this->num_streams].buf_type = BUF_AUDIO_DIVXA; - break; - case 0x02: - this->streams[this->num_streams].buf_type = BUF_AUDIO_MSADPCM; - break; - case 0x11: - this->streams[this->num_streams].buf_type = BUF_AUDIO_IMAADPCM; - break; - case 0x31: - case 0x32: - this->streams[this->num_streams].buf_type = BUF_AUDIO_MSGSM; - break; - default: + this->streams[this->num_streams].buf_type = + formattag_to_buf_audio ( wavex->wFormatTag ); + + if ( !this->streams[this->num_streams].buf_type ) { printf ("demux_asf: unknown audio type 0x%x\n", wavex->wFormatTag); this->streams[this->num_streams].buf_type = BUF_CONTROL_NOP; - break; } - - printf ("demux_asf: audio format :0x%02x (buf_type %08x)\n", - wavex->wFormatTag, this->streams[this->num_streams].buf_type ); - + else + printf ("demux_asf: audio format : %s (wFormatTag 0x%x)\n", + buf_audio_name(this->streams[this->num_streams].buf_type), + wavex->wFormatTag); this->streams[this->num_streams].buf_type |= this->num_audio_streams; this->streams[this->num_streams].fifo = this->audio_fifo; diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index a144b7344..81afaf1f9 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.49 2001/11/07 18:26:36 miguelfreitas Exp $ + * $Id: demux_avi.c,v 1.50 2001/11/07 19:06:15 miguelfreitas Exp $ * * demultiplexer for avi streams * @@ -879,37 +879,18 @@ static void demux_avi_start (demux_plugin_t *this_gen, printf ("demux_avi: video format = %s, audio format = 0x%lx\n", this->avi->compressor, this->avi->a_fmt); this->no_audio = 0; - switch (this->avi->a_fmt) { - case 0x01: - this->avi->audio_type = BUF_AUDIO_LPCM_LE; - break; - case 0x2000: - this->avi->audio_type = BUF_AUDIO_A52; - break; - case 0x50: - case 0x55: - this->avi->audio_type = BUF_AUDIO_MPEG; - break; - case 0x160: - case 0x161: - this->avi->audio_type = BUF_AUDIO_DIVXA; - break; - case 0x02: - this->avi->audio_type = BUF_AUDIO_MSADPCM; - break; - case 0x11: - this->avi->audio_type = BUF_AUDIO_IMAADPCM; - break; - case 0x31: - case 0x32: - this->avi->audio_type = BUF_AUDIO_MSGSM; - break; - default: + + this->avi->audio_type = formattag_to_buf_audio (this->avi->a_fmt); + + if( !this->avi->audio_type ) { printf ("demux_avi: unknown audio type 0x%lx\n", this->avi->a_fmt); this->no_audio = 1; - this->avi->audio_type = BUF_AUDIO_MPEG; - break; + this->avi->audio_type = BUF_CONTROL_NOP; } + else + printf ("demux_avi: audio type %s (wFormatTag 0x%x)\n", + buf_audio_name(this->avi->audio_type), + (int)this->avi->a_fmt); AVI_seek_start (this->avi); |