diff options
Diffstat (limited to 'dom/media/platforms/wmf')
-rw-r--r-- | dom/media/platforms/wmf/WMFAudioMFTManager.cpp | 13 | ||||
-rw-r--r-- | dom/media/platforms/wmf/WMFAudioMFTManager.h | 1 |
2 files changed, 13 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", diff --git a/dom/media/platforms/wmf/WMFAudioMFTManager.h b/dom/media/platforms/wmf/WMFAudioMFTManager.h index 5bbbc6108a..1f803a0e98 100644 --- a/dom/media/platforms/wmf/WMFAudioMFTManager.h +++ b/dom/media/platforms/wmf/WMFAudioMFTManager.h @@ -47,6 +47,7 @@ private: HRESULT UpdateOutputType(); uint32_t mAudioChannels; + uint32_t mChannelsMap; uint32_t mAudioRate; nsTArray<BYTE> mUserData; |