From f06e42a82e6b1ec7505d7b74de95030e88bf8a13 Mon Sep 17 00:00:00 2001 From: Ristellise Date: Fri, 1 Oct 2021 22:21:41 +0800 Subject: [PATCH] [Shinon] Change Mono Downmixing to Stereo Downmixing --- src/audio_provider_ffmpegsource.cpp | 5 +++-- src/preferences.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/audio_provider_ffmpegsource.cpp b/src/audio_provider_ffmpegsource.cpp index 176a0ad81..405116b05 100644 --- a/src/audio_provider_ffmpegsource.cpp +++ b/src/audio_provider_ffmpegsource.cpp @@ -166,10 +166,11 @@ void FFmpegSourceAudioProvider::LoadAudio(agi::fs::path const& filename) { } if (OPT_GET("Provider/Audio/FFmpegSource/Downmix")->GetBool()) { - if (channels > 1 || bytes_per_sample != 2 || float_samples) { + if (channels > 2 || bytes_per_sample != 2 || float_samples) { std::unique_ptr opt(FFMS_CreateResampleOptions(AudioSource), FFMS_DestroyResampleOptions); - opt->ChannelLayout = FFMS_CH_FRONT_CENTER; + if (channels > 2) + opt->ChannelLayout = FFMS_CH_FRONT_LEFT | FFMS_CH_FRONT_RIGHT; opt->SampleFormat = FFMS_FMT_S16; // Might fail if FFMS2 wasn't built with libavresample diff --git a/src/preferences.cpp b/src/preferences.cpp index 91ebacee7..703937324 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -401,7 +401,8 @@ void Advanced_Audio(wxTreebook *book, Preferences *parent) { p->OptionChoice(ffms, _("Audio indexing error handling mode"), error_modes_choice, "Provider/Audio/FFmpegSource/Decode Error Handling"); p->OptionAdd(ffms, _("Always index all audio tracks"), "Provider/FFmpegSource/Index All Tracks"); - p->OptionAdd(ffms, _("Downmix to 16bit mono audio"), "Provider/Audio/FFmpegSource/Downmix"); + wxControl* stereo = p->OptionAdd(ffms, _("Downmix to stereo"), "Provider/Audio/FFmpegSource/Downmix"); + stereo->SetToolTip("Reduces memory usage on surround audio, but may cause audio tracks to sound blank in specific circumstances. This will not affect audio with two channels or less."); #endif #ifdef WITH_PORTAUDIO