Skip to content

Commit

Permalink
Fix mono audio playback on Chrome. Issue # 75
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Murray committed Dec 8, 2015
1 parent 8417f3a commit 94f4d63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/demux/tsdemuxer.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,10 @@
// multiply frequency by 2 (see table below, equivalent to substract 3)
adtsExtensionSampleingIndex = adtsSampleingIndex - 3;
} else {
// if (manifest codec is AAC) AND (frequency less than 24kHz OR nb channel is 1)
if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && (adtsSampleingIndex >= 6 || adtsChanelConfig === 1)) {
// if (manifest codec is AAC) AND (frequency less than 24kHz OR nb channel is 1) OR (manifest codec not specified and mono audio)
// Chrome fails to play back with AAC LC mono when initialized with HE-AAC. This is not a problem with stereo.
if (audioCodec && audioCodec.indexOf('mp4a.40.2') !== -1 && (adtsSampleingIndex >= 6 || adtsChanelConfig === 1) ||
(!audioCodec && adtsChanelConfig === 1)) {
adtsObjectType = 2;
config = new Array(2);
}
Expand Down

0 comments on commit 94f4d63

Please sign in to comment.