Remove out-of-date Film::_audio_language.
authorCarl Hetherington <cth@carlh.net>
Mon, 5 Apr 2021 22:59:58 +0000 (00:59 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 5 Apr 2021 22:59:58 +0000 (00:59 +0200)
src/lib/film.cc
src/lib/film.h
src/lib/reel_writer.cc

index a9ac82b..4e1e6c5 100644 (file)
@@ -168,7 +168,6 @@ Film::Film (optional<boost::filesystem::path> dir)
        , _user_explicit_container (false)
        , _user_explicit_resolution (false)
        , _name_language (dcp::LanguageTag("en-US"))
-       , _audio_language (dcp::LanguageTag("en-US"))
        , _version_number (1)
        , _status (dcp::Status::FINAL)
        , _luminance (dcp::Luminance(4.5, dcp::Luminance::Unit::FOOT_LAMBERT))
@@ -473,7 +472,6 @@ Film::metadata (bool with_content_paths) const
                root->add_child("ContentVersion")->add_child_text(i);
        }
        root->add_child("NameLanguage")->add_child_text(_name_language.to_string());
-       root->add_child("AudioLanguage")->add_child_text(_audio_language.to_string());
        if (_release_territory) {
                root->add_child("ReleaseTerritory")->add_child_text(_release_territory->subtag());
        }
@@ -650,10 +648,6 @@ Film::read_metadata (optional<boost::filesystem::path> path)
        if (name_language) {
                _name_language = dcp::LanguageTag (*name_language);
        }
-       auto audio_language = f.optional_string_child("AudioLanguage");
-       if (audio_language) {
-               _audio_language = dcp::LanguageTag (*audio_language);
-       }
        auto release_territory = f.optional_string_child("ReleaseTerritory");
        if (release_territory) {
                _release_territory = dcp::LanguageTag::RegionSubtag (*release_territory);
@@ -1997,14 +1991,6 @@ Film::set_name_language (dcp::LanguageTag lang)
 }
 
 
-void
-Film::set_audio_language (dcp::LanguageTag lang)
-{
-       FilmChangeSignaller ch (this, Property::AUDIO_LANGUAGE);
-       _audio_language = lang;
-}
-
-
 void
 Film::set_release_territory (optional<dcp::LanguageTag::RegionSubtag> region)
 {
index 5fc56ac..00c3f71 100644 (file)
@@ -344,10 +344,6 @@ public:
                return _name_language;
        }
 
-       dcp::LanguageTag audio_language () const {
-               return _audio_language;
-       }
-
        boost::optional<dcp::LanguageTag::RegionSubtag> release_territory () const {
                return _release_territory;
        }
@@ -428,7 +424,6 @@ public:
        void set_ratings (std::vector<dcp::Rating> r);
        void set_content_versions (std::vector<std::string> v);
        void set_name_language (dcp::LanguageTag lang);
-       void set_audio_language (dcp::LanguageTag lang);
        void set_release_territory (boost::optional<dcp::LanguageTag::RegionSubtag> region = boost::none);
        void set_version_number (int v);
        void set_status (dcp::Status s);
@@ -536,7 +531,6 @@ private:
        std::vector<dcp::Rating> _ratings;
        std::vector<std::string> _content_versions;
        dcp::LanguageTag _name_language;
-       dcp::LanguageTag _audio_language;
        boost::optional<dcp::LanguageTag::RegionSubtag> _release_territory;
        int _version_number;
        dcp::Status _status;
index 2c55f0f..3eb4316 100644 (file)
@@ -166,8 +166,13 @@ ReelWriter::ReelWriter (
        }
 
        if (film()->audio_channels()) {
+               auto langs = film()->audio_languages();
                _sound_asset = make_shared<dcp::SoundAsset> (
-                       dcp::Fraction(film()->video_frame_rate(), 1), film()->audio_frame_rate(), film()->audio_channels(), film()->audio_language(), standard
+                       dcp::Fraction(film()->video_frame_rate(), 1),
+                       film()->audio_frame_rate(),
+                       film()->audio_channels(),
+                       langs.empty() ? dcp::LanguageTag("en-US") : langs.front(),
+                       standard
                        );
 
                _sound_asset->set_metadata (mxf_metadata());