summaryrefslogtreecommitdiff
path: root/command/demux.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'command/demux.cpp')
-rw-r--r--command/demux.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/command/demux.cpp b/command/demux.cpp
index 2ee198b..b136d17 100644
--- a/command/demux.cpp
+++ b/command/demux.cpp
@@ -70,7 +70,7 @@ void cPaketQueue::Resize(int NewSize, const char *NewName)
uchar *tmp=(uchar *) realloc(buffer,NewSize+8);
if (tmp)
{
- buffer=tmp;
+ buffer=tmp;
maxqueue=NewSize;
}
else
@@ -288,25 +288,6 @@ int cPaketQueue::findaudioheader(int start, int *framesize, int *headersize, boo
if (framesize)
{
- int bitRates[3][3][16] = // all values are specified as kbits/s
- {
- {
- { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, -1 }, // M1, L1
- { 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, -1 }, // M1, L2
- { 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1 } // M1, L3
- },
- {
- { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, -1 }, // M2, L1
- { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1 }, // M2, L2
- { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1 } // M2, L3
- },
- {
- { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, -1 }, // M2.5, L1
- { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1 }, // M2.5, L2
- { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1 } // M2.5, L3
- }
- };
-
int samplingFrequencies[3][4] = // all values are specified in Hz
{
{ 44100, 48000, 32000, -1 }, // MPEG 1
@@ -347,6 +328,25 @@ int cPaketQueue::findaudioheader(int start, int *framesize, int *headersize, boo
*framesize = 0; // "free" Bitrate -> we don't support this!
else
{
+ int bitRates[3][3][16] = // all values are specified as kbits/s
+ {
+ {
+ { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, -1 }, // M1, L1
+ { 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, -1 }, // M1, L2
+ { 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1 } // M1, L3
+ },
+ {
+ { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, -1 }, // M2, L1
+ { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1 }, // M2, L2
+ { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1 } // M2, L3
+ },
+ {
+ { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, -1 }, // M2.5, L1
+ { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1 }, // M2.5, L2
+ { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1 } // M2.5, L3
+ }
+ };
+
int br = 1000 * bitRates[mpegIndex][layerIndex][mp2hdr->BitRateIndex]; // bits/s
int N = slots_per_frame[mpegIndex][layerIndex] * br / sf; // slots