[MPlayer-dev-eng] [PATCH] liba52 problems with 2-ch vob, 6-ch output

Arpi arpi at thot.banki.hu
Thu Dec 27 03:50:10 CET 2001


Hi,

> > The problem:
> > Some of the vobs have ac3 sound with only 2 channels (A52_DOLBY format).
> > Liba52 does not "upmix" the output to 5+1 channels, so this causes a lot of
> > garbage in the sound output (this is described in liba52.txt).
> 
> i think this should be fixed in liba52's downsample.c, or at worst case, at
> resample.c. (there are upsampling code too at downsample.c)

look at dec_audio.c:

        switch(sh_audio->channels){
            case 1: flags=A52_MONO; break;
//          case 2: flags=A52_STEREO; break;
            case 2: flags=A52_DOLBY; break;
//          case 3: flags=A52_3F; break;
            case 3: flags=A52_2F1R; break;
            case 4: flags=A52_2F2R; break; // 2+2
            case 5: flags=A52_3F2R; break;
            case 6: flags=A52_3F2R|A52_LFE; break; // 5.1
        }
        flags|=A52_ADJUST_LEVEL;
        sh_audio->a_in_buffer_len=0;
        if (a52_frame (&a52_state, sh_audio->a_in_buffer, &flags, &level,bias))
            mp_msg(MSGT_DECAUDIO,MSGL_WARN,"a52: error decoding frame\n");
            break;
        }

it will setup channel mode depending on user-spefied number of channels.
liba52 should down/upmix any format to this mode.

you mean, it fails here? (you request A52_3F2R|A52_LFE, but it does A52_DOLBY ?)
if yes, then it's liba52's bug/limitation. i think it's bug, as downmix.c
seems to have lots of conversion for all possible cases (even for mono->6ch)

you should add printf to print value of 'flags' before and after the call to
decoder:
        if (a52_frame (&a52_state, sh_audio->a_in_buffer, &flags, &level, bias))
to see if it changes 'flags'.

please tell me the results, i have no such card.
(really i have, sb live, but i got errors when requesting more
than 2 channels. maybe i should use different driver, from creative site or
alsa??? - i'm using oss driver of 2.4.7)


A'rpi / Astral & ESP-team

--
mailto:arpi at thot.banki.hu
http://esp-team.scene.hu



More information about the MPlayer-dev-eng mailing list