Disallow referring to OV audio unless channel counts match (#2780).
authorCarl Hetherington <cth@carlh.net>
Mon, 26 Feb 2024 22:18:15 +0000 (23:18 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 26 Feb 2024 22:18:15 +0000 (23:18 +0100)
src/lib/dcp_content.cc
src/wx/audio_panel.cc

index 6185b3a19db2cfbd4e49474794b3b3057154022a..bdd5e0e091c0aa6b523ec7c7400ec9449beef3a0 100644 (file)
@@ -720,6 +720,14 @@ DCPContent::can_reference_audio (shared_ptr<const Film> film, string& why_not) c
                return false;
        }
 
+       if (audio && audio->stream()) {
+               auto const channels = audio->stream()->channels();
+               if (channels != film->audio_channels()) {
+                       why_not = String::compose(_("it has a different number of audio channels than the project; set the project to have %1 channels."), channels);
+                       return false;
+               }
+       }
+
        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
        return can_reference(
                film, [](shared_ptr<const Content> c) {
index f0863431a04b01bebad4feee14b08291c7b74a29..fcadd0c68fa6deccce4c48f9fda17ed0a9a50275 100644 (file)
@@ -208,6 +208,7 @@ AudioPanel::film_changed (FilmProperty property)
        case FilmProperty::AUDIO_PROCESSOR:
                _mapping->set_output_channels (_parent->film()->audio_output_names ());
                setup_peak ();
+               setup_sensitivity();
                break;
        case FilmProperty::VIDEO_FRAME_RATE:
                setup_description ();