Ticket #230: 0004-Don-t-set-a52_flags-based-on-number-of-channels-we.patch

File 0004-Don-t-set-a52_flags-based-on-number-of-channels-we.patch, 1.5 kB (added by dconrad, 3 years ago)

Don't set a52_flags based on number of channels; we can handle whatever the stream is

  • a/A52/ACShepA52Decoder.cpp

    old new  
    751751                } 
    752752                else 
    753753                { 
    754                         switch(mOutputFormat.mChannelsPerFrame) { 
    755                                 case 1: 
    756                                         // Just mono 
    757                                         a52_flags = A52_MONO | A52_ADJUST_LEVEL; 
    758                                         break; 
    759                                          
    760                                 case 2: 
    761                                         // All we really need is stereophonic, baby 
    762                                         a52_flags = TwoChannelMode; 
    763                                         break; 
    764                                          
    765                                 case 5: 
    766                                         // Try to get 5.0 channels 
    767                                         a52_flags = A52_3F2R | A52_ADJUST_LEVEL;         
    768                                         break; 
    769                                          
    770                                 case 6: 
    771                                         // Try to get 5.1 channels 
    772                                         a52_flags = A52_3F2R | A52_LFE | A52_ADJUST_LEVEL; 
    773                                         break; 
    774                                          
    775                                 default: 
    776                                         fprintf(stderr, "ACShepA52Decoder::ProduceOutputPackets: Unknown output channel amount\n"); 
    777                                         break; 
    778                         } 
    779  
     754                        if (mOutputFormat.mChannelsPerFrame == 2) 
     755                                a52_flags = TwoChannelMode; 
     756                        else 
     757                                a52_flags |= A52_ADJUST_LEVEL; 
     758                         
    780759                        readLength = bytes_to_read; 
    781760                        input_data = GetBytes(readLength); 
    782761                        a52_frame(decoder_state, input_data, &a52_flags, &level, bias);