From bb13e90ba1a8f76d835b191f12867fffe8e9a611 Mon Sep 17 00:00:00 2001 From: James Courtier-Dutton Date: Fri, 9 May 2003 20:17:29 +0000 Subject: 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 --- ChangeLog | 2 ++ src/demuxers/demux_wav.c | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11236e5b3..b04e2d96f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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; } -- cgit v1.2.3