changeset 21987:fed73db9ddb1

Use interleaver id to select the correct interleaver instead of guessing it from the codec id. Fixes gittin_13.ra
author rtogni
date Wed, 24 Jan 2007 15:05:42 +0000
parents 85d0b02f2a2d
children dbdd1a73c7f7
files libmpdemux/demux_realaud.c
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_realaud.c	Wed Jan 24 10:31:51 2007 +0000
+++ b/libmpdemux/demux_realaud.c	Wed Jan 24 15:05:42 2007 +0000
@@ -22,6 +22,8 @@
 #define FOURCC_DNET mmioFOURCC('d','n','e','t')
 #define FOURCC_LPCJ mmioFOURCC('l','p','c','J')
 #define FOURCC_SIPR mmioFOURCC('s','i','p','r')
+#define INTLID_INT4 mmioFOURCC('I','n','t','4')
+#define INTLID_SIPR mmioFOURCC('s','i','p','r')
 
 
 static unsigned char sipr_swaps[38][2]={
@@ -46,7 +48,7 @@
 	unsigned short sub_packet_h;
 	unsigned short frame_size;
 	unsigned short sub_packet_size;
-	char genr[4];
+	unsigned intl_id;
 	unsigned char *audio_buf;
 } ra_priv_t;
 
@@ -84,8 +86,8 @@
 	len = wf->nBlockAlign;
 	demuxer->filepos = stream_tell(demuxer->stream);
 
-    if ((sh->format == FOURCC_288) || (sh->format == FOURCC_SIPR)) {
-      if (sh->format == FOURCC_SIPR) {
+    if ((ra_priv->intl_id == INTLID_INT4) || (ra_priv->intl_id == INTLID_SIPR)) {
+      if (ra_priv->intl_id == INTLID_SIPR) {
         int n;
         int bs = ra_priv->sub_packet_h * ra_priv->frame_size * 2 / 96;  // nibbles per subpacket
         stream_read(demuxer->stream, ra_priv->audio_buf, ra_priv->sub_packet_h * ra_priv->frame_size);
@@ -199,12 +201,9 @@
 		mp_msg(MSGT_DEMUX,MSGL_V,"[RealAudio] %d channel, %d bit, %dHz\n", sh->channels,
 			sh->samplesize, sh->samplerate);
 		i = stream_read_char(demuxer->stream);
-		ra_priv->genr[0] = stream_read_char(demuxer->stream);
-		ra_priv->genr[1] = stream_read_char(demuxer->stream);
-		ra_priv->genr[2] = stream_read_char(demuxer->stream);
-		ra_priv->genr[3] = stream_read_char(demuxer->stream);
+		ra_priv->intl_id = stream_read_dword_le(demuxer->stream);
 		if (i != 4) {
-			mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] Genr size is not 4 (%d), please report to "
+			mp_msg(MSGT_DEMUX,MSGL_WARN,"[RealAudio] Interleaver Id size is not 4 (%d), please report to "
 				"MPlayer developers\n", i);
 			stream_skip(demuxer->stream, i - 4);
 		}