
Hi all !

I recently bought a set of dvds whose sound is mpeg-1 layer II, with in
the headers the two 'emphasis' bits set to 1.

The first check done in adec_SyncFrame (adec_generic.c) rejects frames
with such a header. Thus, I could not get any sound. Changing the test,
the sound played perfectly.

I've looked at mpg123, smpeg, and an implementation from the ISO team
(found at http://www.mp3-tech.org/programmer/sources/dist10.tgz ), none
of these seems to take into account those two bits.

Is there any reason for such a discrimination on the 'emphasis' ?

Attached is a small patch that modifies the header check. It also fixes a
segfault caused by a wrong test on the layer index.

-- 
Prof


-- Attached file included as plaintext by Listar --
-- Desc: Patch

Index: src/audio_decoder/adec_generic.c
===================================================================
RCS file: /var/cvs/videolan/vlc/src/audio_decoder/adec_generic.c,v
retrieving revision 1.5
diff -u -r1.5 adec_generic.c
--- src/audio_decoder/adec_generic.c	2001/04/06 09:15:47	1.5
+++ src/audio_decoder/adec_generic.c	2001/09/01 10:58:07
@@ -87,7 +87,7 @@
     p_adec->header = header;
 
     /* basic header check : sync word, no emphasis */
-    if( (header & 0xfff00003) != 0xfff00000 )
+    if( (header & 0xfff00000) != 0xfff00000 )
     {
         return 1;
     }
@@ -95,7 +95,7 @@
     /* calculate bit rate */
     index = ( header >> 17 ) & 7; /* mpeg ID + layer */
     bit_rates = bit_rate_table[ index ];
-    if( bit_rate_table == NULL )
+    if( bit_rates == NULL )
     {
         return 1; /* invalid layer */
     }



