diff options
author | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2003-05-09 20:17:29 +0000 |
---|---|---|
committer | James Courtier-Dutton <jcdutton@users.sourceforge.net> | 2003-05-09 20:17:29 +0000 |
commit | bb13e90ba1a8f76d835b191f12867fffe8e9a611 (patch) | |
tree | a4fb2b05db92db01e69c68e505d8eee605ab169b | |
parent | 855690dec40407a66b732ad6c0f68ddeedbd5102 (diff) | |
download | xine-lib-bb13e90ba1a8f76d835b191f12867fffe8e9a611.tar.gz xine-lib-bb13e90ba1a8f76d835b191f12867fffe8e9a611.tar.bz2 |
Support A52 .WAV files that think they are PCM, but in fact the content is A52.
Works for software A52 decode. Does not work for A52 Passthru, due to the lack of re-sync code in li
ba52 passthru mode code. Re-Sync code just needs implementing.
CVS patchset: 4807
CVS date: 2003/05/09 20:17:29
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/demuxers/demux_wav.c | 22 |
2 files changed, 19 insertions, 5 deletions
@@ -1,6 +1,8 @@ xine-lib (1-beta12) * playback of theorastreams added * updated nvtv support, and bug fixes + * ac3 pcm-audiotype .wav files now supported via software decode. + Passthru not implemented yet due to lack of re-sync code in liba52 passthru mode. * playback of cd/dvd over the network (see README.network_dvd) * use variable block program stream demuxer for mpeg2 files * cdda improvements (error handling, device on mrl) diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index 058c4052a..e3048abce 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -20,7 +20,7 @@ * MS WAV File Demuxer by Mike Melanson (melanson@pcisys.net) * based on WAV specs that are available far and wide * - * $Id: demux_wav.c,v 1.41 2003/04/17 19:01:33 miguelfreitas Exp $ + * $Id: demux_wav.c,v 1.42 2003/05/09 20:17:29 jcdutton Exp $ * */ @@ -86,10 +86,10 @@ typedef struct { /* returns 1 if the WAV file was opened successfully, 0 otherwise */ static int open_wav_file(demux_wav_t *this) { - unsigned char signature[WAV_SIGNATURE_SIZE]; - unsigned int chunk_tag; - unsigned int chunk_size; - unsigned char chunk_preamble[8]; + uint8_t signature[WAV_SIGNATURE_SIZE]; + uint32_t chunk_tag; + uint32_t chunk_size; + uint8_t chunk_preamble[8]; /* check the signature */ if (!xine_demux_read_header(this->input, signature, WAV_SIGNATURE_SIZE)) @@ -148,6 +148,18 @@ static int open_wav_file(demux_wav_t *this) { this->input->seek(this->input, chunk_size, SEEK_CUR); } } + if (this->audio_type == BUF_AUDIO_LPCM_LE) { + if (this->input->read(this->input, chunk_preamble, 4) != 4 ) { + free (this->wave); + return 0; + } + if (chunk_preamble[0] == 0x72 && + chunk_preamble[1] == 0xf8 && + chunk_preamble[2] == 0x1f && + chunk_preamble[3] == 0x4e ) { + this->audio_type = BUF_AUDIO_DNET; + } + } return 1; } |