From 39948b1150feb17a504c8f051c16ecc213f776f9 Mon Sep 17 00:00:00 2001
From: David Conrad <davedc@Crescens.local>
Date: Sun, 5 Aug 2007 03:00:44 -0400
Subject: [PATCH] Don't set a52_flags based on number of channels; we can handle whatever the stream is
---
A52/ACShepA52Decoder.cpp | 31 +++++--------------------------
1 files changed, 5 insertions(+), 26 deletions(-)
diff --git a/A52/ACShepA52Decoder.cpp b/A52/ACShepA52Decoder.cpp
index 5bef1c8..4d0b994 100644
|
a
|
b
|
|
| 751 | 751 | } |
| 752 | 752 | else |
| 753 | 753 | { |
| 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 | |
| 780 | 759 | readLength = bytes_to_read; |
| 781 | 760 | input_data = GetBytes(readLength); |
| 782 | 761 | a52_frame(decoder_state, input_data, &a52_flags, &level, bias); |