summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEwald Snel <esnel@users.sourceforge.net>2003-05-06 20:19:56 +0000
committerEwald Snel <esnel@users.sourceforge.net>2003-05-06 20:19:56 +0000
commit78ae9df0951481d83e7a32d05d0677145034382a (patch)
tree07c373b9d27d8818369aea92440198117d9d9cf7
parente01b03957ba5cfa98b31c665111f2fd69f9d4000 (diff)
downloadxine-lib-78ae9df0951481d83e7a32d05d0677145034382a.tar.gz
xine-lib-78ae9df0951481d83e7a32d05d0677145034382a.tar.bz2
Fix decoding of some Real 28.8 files (such as 'KAZ1.ra' from MPlayer ftp)
CVS patchset: 4784 CVS date: 2003/05/06 20:19:56
-rw-r--r--src/demuxers/demux_realaudio.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c
index 6d0115b97..a184e6f69 100644
--- a/src/demuxers/demux_realaudio.c
+++ b/src/demuxers/demux_realaudio.c
@@ -19,7 +19,7 @@
*
* RealAudio File Demuxer by Mike Melanson (melanson@pcisys.net)
*
- * $Id: demux_realaudio.c,v 1.19 2003/04/17 19:01:27 miguelfreitas Exp $
+ * $Id: demux_realaudio.c,v 1.20 2003/05/06 20:19:56 esnel Exp $
*
*/
@@ -104,7 +104,7 @@ static int open_ra_file(demux_ra_t *this) {
return 0;
/* find the important information */
- this->data_start = RA_FILE_HEADER_SIZE + RA_AUDIO_HEADER_SIZE;
+ this->data_start = RA_FILE_HEADER_SIZE + BE_32(&audio_header[0x02]);
this->data_size = BE_32(&audio_header[0x0C]);
this->wave.nChannels = audio_header[0x27];
this->wave.nSamplesPerSec = BE_16(&audio_header[0x20]);
@@ -113,6 +113,11 @@ static int open_ra_file(demux_ra_t *this) {
this->audio_fourcc = *(unsigned int *)&audio_header[0x2E];
this->audio_type = formattag_to_buf_audio(this->audio_fourcc);
+ /* skip extra header data (such as song title etc.) */
+ if (this->input->seek(this->input, this->data_start, SEEK_SET) !=
+ this->data_start)
+ return 0;
+
if( !this->audio_type )
this->audio_type = BUF_AUDIO_UNKNOWN;