From de96b625f6d066ddb8b51786861673b92ce92024 Mon Sep 17 00:00:00 2001 From: brabebhin <9284164+brabebhin@users.noreply.github.com> Date: Thu, 21 Nov 2024 12:54:20 +0200 Subject: [PATCH] fix stereo downmix on 32 bit PCM (#441) Co-authored-by: Brabebhin --- Source/UncompressedAudioSampleProvider.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/UncompressedAudioSampleProvider.cpp b/Source/UncompressedAudioSampleProvider.cpp index 74bb9ca0ff..2d48af7513 100644 --- a/Source/UncompressedAudioSampleProvider.cpp +++ b/Source/UncompressedAudioSampleProvider.cpp @@ -145,11 +145,12 @@ void UncompressedAudioSampleProvider::SetMediaEncodingProperties(AVSampleFormat // set encoding properties encodingProperties.Subtype(outSampleFormat == AV_SAMPLE_FMT_FLT ? MediaEncodingSubtypes::Float() : MediaEncodingSubtypes::Pcm()); + encodingProperties.Properties().Insert(MF_MT_AUDIO_CHANNEL_MASK, winrt::box_value(reportedChannelLayout)); + encodingProperties.BitsPerSample(bitsPerSample); encodingProperties.SampleRate(outSampleRate); encodingProperties.ChannelCount(outChannelLayout.nb_channels); encodingProperties.Bitrate(bitsPerSample * outSampleRate * outChannelLayout.nb_channels); - encodingProperties.Properties().Insert(MF_MT_AUDIO_CHANNEL_MASK, winrt::box_value(reportedChannelLayout)); } HRESULT UncompressedAudioSampleProvider::CheckFormatChanged(AVSampleFormat format, const AVChannelLayout& channelLayout, int sampleRate)