summaryrefslogtreecommitdiff
path: root/dom/media/platforms/wmf/WMFAudioMFTManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/platforms/wmf/WMFAudioMFTManager.cpp')
-rw-r--r--dom/media/platforms/wmf/WMFAudioMFTManager.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/dom/media/platforms/wmf/WMFAudioMFTManager.cpp b/dom/media/platforms/wmf/WMFAudioMFTManager.cpp
index 3dacdf0aad..cf1ebb1cff 100644
--- a/dom/media/platforms/wmf/WMFAudioMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFAudioMFTManager.cpp
@@ -84,6 +84,7 @@ AACAudioSpecificConfigToUserData(uint8_t aAACProfileLevelIndication,
WMFAudioMFTManager::WMFAudioMFTManager(
const AudioInfo& aConfig)
: mAudioChannels(aConfig.mChannels)
+ , mChannelsMap(AudioConfig::ChannelLayout::UNKNOWN_MAP)
, mAudioRate(aConfig.mRate)
, mAudioFrameSum(0)
, mMustRecaptureAudioPosition(true)
@@ -212,6 +213,15 @@ WMFAudioMFTManager::UpdateOutputType()
hr = type->GetUINT32(MF_MT_AUDIO_NUM_CHANNELS, &mAudioChannels);
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
+ uint32_t channelsMap;
+ hr = type->GetUINT32(MF_MT_AUDIO_CHANNEL_MASK, &channelsMap);
+ if (SUCCEEDED(hr)) {
+ mChannelsMap = channelsMap;
+ } else {
+ LOG("Unable to retrieve channel layout. Ignoring");
+ mChannelsMap = AudioConfig::ChannelLayout::UNKNOWN_MAP;
+ }
+
AudioConfig::ChannelLayout layout(mAudioChannels);
if (!layout.IsValid()) {
return E_FAIL;
@@ -338,7 +348,8 @@ WMFAudioMFTManager::Output(int64_t aStreamOffset,
numFrames,
Move(audioData),
mAudioChannels,
- mAudioRate);
+ mAudioRate,
+ mChannelsMap);
#ifdef LOG_SAMPLE_DECODE
LOG("Decoded audio sample! timestamp=%lld duration=%lld currentLength=%u",