From 3ed1e5038f33d89078c035060c5f2da10c5a31ad Mon Sep 17 00:00:00 2001 From: flim Date: Fri, 18 Oct 2024 15:47:16 -0400 Subject: [PATCH] When converting ADM files, always use HEADPHONES_RENDERING_MODE_BINAURAL. PiperOrigin-RevId: 687393641 --- .../iamf/mix_presentation_handler.cc | 12 ++---------- .../iamf/tests/mix_presentation_handler_test.cc | 4 ++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/iamf/cli/adm_to_user_metadata/iamf/mix_presentation_handler.cc b/iamf/cli/adm_to_user_metadata/iamf/mix_presentation_handler.cc index 44d7b67..f13d385 100644 --- a/iamf/cli/adm_to_user_metadata/iamf/mix_presentation_handler.cc +++ b/iamf/cli/adm_to_user_metadata/iamf/mix_presentation_handler.cc @@ -142,16 +142,8 @@ absl::Status SubMixAudioElementHandler( return input_layout.status(); } - // Set 'headphones_rendering_mode' to HEADPHONES_RENDERING_MODE_BINAURAL if - // typeDefinition is binaural, else set it to - // HEADPHONES_RENDERING_MODE_STEREO. - if (*input_layout == IamfInputLayout::kBinaural) { - rendering_config->set_headphones_rendering_mode( - iamf_tools_cli_proto::HEADPHONES_RENDERING_MODE_BINAURAL); - } else { - rendering_config->set_headphones_rendering_mode( - iamf_tools_cli_proto::HEADPHONES_RENDERING_MODE_STEREO); - } + rendering_config->set_headphones_rendering_mode( + iamf_tools_cli_proto::HEADPHONES_RENDERING_MODE_BINAURAL); auto* mix_gain_param_definition = sub_mix_audio_element.mutable_element_mix_gain(); diff --git a/iamf/cli/adm_to_user_metadata/iamf/tests/mix_presentation_handler_test.cc b/iamf/cli/adm_to_user_metadata/iamf/tests/mix_presentation_handler_test.cc index 1e23eef..9d92713 100644 --- a/iamf/cli/adm_to_user_metadata/iamf/tests/mix_presentation_handler_test.cc +++ b/iamf/cli/adm_to_user_metadata/iamf/tests/mix_presentation_handler_test.cc @@ -124,7 +124,7 @@ TEST(PopulateMixPresentation, PopulatesStereoSubmix) { EXPECT_EQ(submix.output_mix_gain().default_mix_gain(), 0); } -TEST(PopulateMixPresentation, SetsStereoRenderingModeForStereoAudioObject) { +TEST(PopulateMixPresentation, SetsBinauralRenderingModeForStereoAudioObject) { const auto& mix_presentation_metadata = GetMixObuMetataExpectOk({GetStereoAudioObject()}); @@ -132,7 +132,7 @@ TEST(PopulateMixPresentation, SetsStereoRenderingModeForStereoAudioObject) { .audio_elements(0) .rendering_config() .headphones_rendering_mode(), - iamf_tools_cli_proto::HEADPHONES_RENDERING_MODE_STEREO); + iamf_tools_cli_proto::HEADPHONES_RENDERING_MODE_BINAURAL); } TEST(PopulateMixPresentation, SetsBinauralRenderingModeForBinauralAudioObject) {