Signal when streams change and rebuild player pieces when it happens.
authorCarl Hetherington <cth@carlh.net>
Wed, 25 Apr 2018 23:22:52 +0000 (00:22 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 25 Apr 2018 23:22:52 +0000 (00:22 +0100)
src/lib/dcp_content.cc
src/lib/player.cc

index 7d9766a..b5209e2 100644 (file)
@@ -155,16 +155,11 @@ DCPContent::examine (shared_ptr<Job> job)
        video->take_from_examiner (examiner);
        set_default_colour_conversion ();
 
-       {
-               boost::mutex::scoped_lock lm (_mutex);
-
-               AudioStreamPtr as (new AudioStream (examiner->audio_frame_rate(), examiner->audio_length(), examiner->audio_channels()));
-               audio->set_stream (as);
-               AudioMapping m = as->mapping ();
-               film()->make_audio_mapping_default (m);
-               as->set_mapping (m);
-       }
-
+       AudioStreamPtr as (new AudioStream (examiner->audio_frame_rate(), examiner->audio_length(), examiner->audio_channels()));
+       audio->set_stream (as);
+       AudioMapping m = as->mapping ();
+       film()->make_audio_mapping_default (m);
+       as->set_mapping (m);
        signal_changed (AudioContentProperty::STREAMS);
 
        bool has_subtitles = false;
@@ -202,6 +197,8 @@ DCPContent::examine (shared_ptr<Job> job)
                signal_changed (DCPContentProperty::NAME);
        }
 
+       signal_changed (AudioContentProperty::STREAMS);
+
        video->set_frame_type (_three_d ? VIDEO_FRAME_TYPE_3D : VIDEO_FRAME_TYPE_2D);
 }
 
index 6fcf579..c7d7b2f 100644 (file)
@@ -206,14 +206,15 @@ Player::playlist_content_changed (weak_ptr<Content> w, int property, bool freque
                property == ContentProperty::TRIM_END ||
                property == ContentProperty::PATH ||
                property == VideoContentProperty::FRAME_TYPE ||
+               property == VideoContentProperty::COLOUR_CONVERSION ||
+               property == AudioContentProperty::STREAMS ||
                property == DCPContentProperty::NEEDS_ASSETS ||
                property == DCPContentProperty::NEEDS_KDM ||
                property == SubtitleContentProperty::COLOUR ||
                property == SubtitleContentProperty::EFFECT ||
                property == SubtitleContentProperty::EFFECT_COLOUR ||
                property == FFmpegContentProperty::SUBTITLE_STREAM ||
-               property == FFmpegContentProperty::FILTERS ||
-               property == VideoContentProperty::COLOUR_CONVERSION
+               property == FFmpegContentProperty::FILTERS
                ) {
 
                _have_valid_pieces = false;