mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Convert bitrates to bps before setting it
Format expects the values of `averageBitrate` and `peakBitrate` in bps and the value fetched from AC3SpecificBox and EC3SpecificBox is in kbps. PiperOrigin-RevId: 490756581 (cherry picked from commit 4066970ce7292642794f4a3954f8d0fde78dd310)
This commit is contained in:
parent
5ebbdc52cb
commit
30dce91fc0
@ -162,7 +162,7 @@ public final class Ac3Util {
|
||||
channelCount++;
|
||||
}
|
||||
int halfFrmsizecod = dataBitArray.readBits(5); // bit_rate_code
|
||||
int constantBitrate = BITRATE_BY_HALF_FRMSIZECOD[halfFrmsizecod];
|
||||
int constantBitrate = BITRATE_BY_HALF_FRMSIZECOD[halfFrmsizecod] * 1000;
|
||||
// Update data position
|
||||
dataBitArray.byteAlign();
|
||||
data.setPosition(dataBitArray.getBytePosition());
|
||||
@ -193,7 +193,7 @@ public final class Ac3Util {
|
||||
ParsableBitArray dataBitArray = new ParsableBitArray();
|
||||
dataBitArray.reset(data);
|
||||
|
||||
int peakBitrate = dataBitArray.readBits(13); // data_rate
|
||||
int peakBitrate = dataBitArray.readBits(13) * 1000; // data_rate
|
||||
dataBitArray.skipBits(3); // num_ind_sub
|
||||
|
||||
// Read the first independent substream.
|
||||
|
@ -10,8 +10,8 @@ track 0:
|
||||
total output bytes = 13824
|
||||
sample count = 9
|
||||
format 0:
|
||||
averageBitrate = 384
|
||||
peakBitrate = 384
|
||||
averageBitrate = 384000
|
||||
peakBitrate = 384000
|
||||
id = 1
|
||||
sampleMimeType = audio/ac3
|
||||
maxInputSize = 1566
|
||||
|
@ -10,8 +10,8 @@ track 0:
|
||||
total output bytes = 9216
|
||||
sample count = 6
|
||||
format 0:
|
||||
averageBitrate = 384
|
||||
peakBitrate = 384
|
||||
averageBitrate = 384000
|
||||
peakBitrate = 384000
|
||||
id = 1
|
||||
sampleMimeType = audio/ac3
|
||||
maxInputSize = 1566
|
||||
|
@ -10,8 +10,8 @@ track 0:
|
||||
total output bytes = 4608
|
||||
sample count = 3
|
||||
format 0:
|
||||
averageBitrate = 384
|
||||
peakBitrate = 384
|
||||
averageBitrate = 384000
|
||||
peakBitrate = 384000
|
||||
id = 1
|
||||
sampleMimeType = audio/ac3
|
||||
maxInputSize = 1566
|
||||
|
@ -10,8 +10,8 @@ track 0:
|
||||
total output bytes = 1536
|
||||
sample count = 1
|
||||
format 0:
|
||||
averageBitrate = 384
|
||||
peakBitrate = 384
|
||||
averageBitrate = 384000
|
||||
peakBitrate = 384000
|
||||
id = 1
|
||||
sampleMimeType = audio/ac3
|
||||
maxInputSize = 1566
|
||||
|
@ -10,8 +10,8 @@ track 0:
|
||||
total output bytes = 13824
|
||||
sample count = 9
|
||||
format 0:
|
||||
averageBitrate = 384
|
||||
peakBitrate = 384
|
||||
averageBitrate = 384000
|
||||
peakBitrate = 384000
|
||||
id = 1
|
||||
sampleMimeType = audio/ac3
|
||||
maxInputSize = 1566
|
||||
|
@ -10,8 +10,8 @@ track 0:
|
||||
total output bytes = 13824
|
||||
sample count = 9
|
||||
format 0:
|
||||
averageBitrate = 384
|
||||
peakBitrate = 384
|
||||
averageBitrate = 384000
|
||||
peakBitrate = 384000
|
||||
id = 1
|
||||
sampleMimeType = audio/ac3
|
||||
channelCount = 6
|
||||
|
@ -10,8 +10,8 @@ track 0:
|
||||
total output bytes = 10752
|
||||
sample count = 7
|
||||
format 0:
|
||||
averageBitrate = 384
|
||||
peakBitrate = 384
|
||||
averageBitrate = 384000
|
||||
peakBitrate = 384000
|
||||
id = 1
|
||||
sampleMimeType = audio/ac3
|
||||
channelCount = 6
|
||||
|
@ -10,8 +10,8 @@ track 0:
|
||||
total output bytes = 6144
|
||||
sample count = 4
|
||||
format 0:
|
||||
averageBitrate = 384
|
||||
peakBitrate = 384
|
||||
averageBitrate = 384000
|
||||
peakBitrate = 384000
|
||||
id = 1
|
||||
sampleMimeType = audio/ac3
|
||||
channelCount = 6
|
||||
|
@ -10,8 +10,8 @@ track 0:
|
||||
total output bytes = 1536
|
||||
sample count = 1
|
||||
format 0:
|
||||
averageBitrate = 384
|
||||
peakBitrate = 384
|
||||
averageBitrate = 384000
|
||||
peakBitrate = 384000
|
||||
id = 1
|
||||
sampleMimeType = audio/ac3
|
||||
channelCount = 6
|
||||
|
@ -10,8 +10,8 @@ track 0:
|
||||
total output bytes = 13824
|
||||
sample count = 9
|
||||
format 0:
|
||||
averageBitrate = 384
|
||||
peakBitrate = 384
|
||||
averageBitrate = 384000
|
||||
peakBitrate = 384000
|
||||
id = 1
|
||||
sampleMimeType = audio/ac3
|
||||
channelCount = 6
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 216000
|
||||
sample count = 54
|
||||
format 0:
|
||||
peakBitrate = 1000
|
||||
peakBitrate = 1000000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3
|
||||
maxInputSize = 4030
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 144000
|
||||
sample count = 36
|
||||
format 0:
|
||||
peakBitrate = 1000
|
||||
peakBitrate = 1000000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3
|
||||
maxInputSize = 4030
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 72000
|
||||
sample count = 18
|
||||
format 0:
|
||||
peakBitrate = 1000
|
||||
peakBitrate = 1000000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3
|
||||
maxInputSize = 4030
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 4000
|
||||
sample count = 1
|
||||
format 0:
|
||||
peakBitrate = 1000
|
||||
peakBitrate = 1000000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3
|
||||
maxInputSize = 4030
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 216000
|
||||
sample count = 54
|
||||
format 0:
|
||||
peakBitrate = 1000
|
||||
peakBitrate = 1000000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3
|
||||
maxInputSize = 4030
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 216000
|
||||
sample count = 54
|
||||
format 0:
|
||||
peakBitrate = 1000
|
||||
peakBitrate = 1000000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3
|
||||
channelCount = 6
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 148000
|
||||
sample count = 37
|
||||
format 0:
|
||||
peakBitrate = 1000
|
||||
peakBitrate = 1000000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3
|
||||
channelCount = 6
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 76000
|
||||
sample count = 19
|
||||
format 0:
|
||||
peakBitrate = 1000
|
||||
peakBitrate = 1000000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3
|
||||
channelCount = 6
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 4000
|
||||
sample count = 1
|
||||
format 0:
|
||||
peakBitrate = 1000
|
||||
peakBitrate = 1000000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3
|
||||
channelCount = 6
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 216000
|
||||
sample count = 54
|
||||
format 0:
|
||||
peakBitrate = 1000
|
||||
peakBitrate = 1000000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3
|
||||
channelCount = 6
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 163840
|
||||
sample count = 64
|
||||
format 0:
|
||||
peakBitrate = 640
|
||||
peakBitrate = 640000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3-joc
|
||||
maxInputSize = 2590
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 110080
|
||||
sample count = 43
|
||||
format 0:
|
||||
peakBitrate = 640
|
||||
peakBitrate = 640000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3-joc
|
||||
maxInputSize = 2590
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 56320
|
||||
sample count = 22
|
||||
format 0:
|
||||
peakBitrate = 640
|
||||
peakBitrate = 640000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3-joc
|
||||
maxInputSize = 2590
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 2560
|
||||
sample count = 1
|
||||
format 0:
|
||||
peakBitrate = 640
|
||||
peakBitrate = 640000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3-joc
|
||||
maxInputSize = 2590
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 163840
|
||||
sample count = 64
|
||||
format 0:
|
||||
peakBitrate = 640
|
||||
peakBitrate = 640000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3-joc
|
||||
maxInputSize = 2590
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 163840
|
||||
sample count = 64
|
||||
format 0:
|
||||
peakBitrate = 640
|
||||
peakBitrate = 640000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3-joc
|
||||
channelCount = 6
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 110080
|
||||
sample count = 43
|
||||
format 0:
|
||||
peakBitrate = 640
|
||||
peakBitrate = 640000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3-joc
|
||||
channelCount = 6
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 56320
|
||||
sample count = 22
|
||||
format 0:
|
||||
peakBitrate = 640
|
||||
peakBitrate = 640000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3-joc
|
||||
channelCount = 6
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 2560
|
||||
sample count = 1
|
||||
format 0:
|
||||
peakBitrate = 640
|
||||
peakBitrate = 640000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3-joc
|
||||
channelCount = 6
|
||||
|
@ -10,7 +10,7 @@ track 0:
|
||||
total output bytes = 163840
|
||||
sample count = 64
|
||||
format 0:
|
||||
peakBitrate = 640
|
||||
peakBitrate = 640000
|
||||
id = 1
|
||||
sampleMimeType = audio/eac3-joc
|
||||
channelCount = 6
|
||||
|
Loading…
x
Reference in New Issue
Block a user