mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Assume AAC-LC (or HE-AAC) in MPEG-TS.
Issue: #774 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=122987179
This commit is contained in:
parent
c539db68ca
commit
075e095cba
1 changed files with 11 additions and 7 deletions
|
|
@ -255,13 +255,17 @@ import java.util.Collections;
|
||||||
|
|
||||||
if (!hasOutputFormat) {
|
if (!hasOutputFormat) {
|
||||||
int audioObjectType = adtsScratch.readBits(2) + 1;
|
int audioObjectType = adtsScratch.readBits(2) + 1;
|
||||||
if (audioObjectType == 1) {
|
if (audioObjectType != 2) {
|
||||||
// The stream indicates AAC Main but it's more likely that the stream contains HE-AAC.
|
// The stream indicates AAC-Main (1), AAC-SSR (3) or AAC-LTP (4). When the stream indicates
|
||||||
// HE-AAC cannot be represented correctly in the ADTS header because it has an
|
// AAC-Main it's more likely that the stream contains HE-AAC (5), which cannot be
|
||||||
// audioObjectType value of 5 whereas an ADTS header can only represent values up to 4.
|
// represented correctly in the 2 bit audio_object_type field in the ADTS header. In
|
||||||
// Since most Android devices don't support AAC Main anyway, we pretend that we're dealing
|
// practice when the stream indicates AAC-SSR or AAC-LTP it more commonly contains AAC-LC or
|
||||||
// with AAC LC and hope for the best. In practice this often works.
|
// HE-AAC. Since most Android devices don't support AAC-Main, AAC-SSR or AAC-LTP, and since
|
||||||
Log.w(TAG, "Detected AAC Main audio, but assuming AAC LC.");
|
// indicating AAC-LC works for HE-AAC streams, we pretend that we're dealing with AAC-LC and
|
||||||
|
// hope for the best. In practice this often works.
|
||||||
|
// See: https://github.com/google/ExoPlayer/issues/774
|
||||||
|
// See: https://github.com/google/ExoPlayer/issues/1383
|
||||||
|
Log.w(TAG, "Detected audio object type: " + audioObjectType + ", but assuming AAC LC.");
|
||||||
audioObjectType = 2;
|
audioObjectType = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue