Clean up; merge two methods.
authorCarl Hetherington <cth@carlh.net>
Thu, 14 Apr 2016 01:25:22 +0000 (02:25 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 18 May 2016 10:50:29 +0000 (11:50 +0100)
src/lib/sndfile_content.cc
src/lib/sndfile_content.h

index ed7e67c3c5198bfa624772124ca03b9967364b8e..a51a7be1d1969a3b1bbb494ef4038c80e5e8f577 100644 (file)
@@ -96,21 +96,16 @@ SndfileContent::examine (shared_ptr<Job> job)
 {
        job->set_progress_unknown ();
        Content::examine (job);
-       shared_ptr<AudioExaminer> dec (new SndfileExaminer (shared_from_this ()));
-       take_from_audio_examiner (dec);
-}
+       shared_ptr<AudioExaminer> ex (new SndfileExaminer (shared_from_this ()));
 
-void
-SndfileContent::take_from_audio_examiner (shared_ptr<AudioExaminer> examiner)
-{
        {
                boost::mutex::scoped_lock lm (_mutex);
-               AudioStreamPtr as (new AudioStream (examiner->audio_frame_rate(), examiner->audio_channels ()));
+               AudioStreamPtr as (new AudioStream (ex->audio_frame_rate(), ex->audio_channels ()));
                audio->set_stream (as);
                AudioMapping m = as->mapping ();
                film()->make_audio_mapping_default (m);
                as->set_mapping (m);
-               _audio_length = examiner->audio_length ();
+               _audio_length = ex->audio_length ();
        }
 
        signal_changed (AudioContentProperty::STREAMS);
index dfd36971d41dbab852cf35730f2ecb42b7c1f809..73d02edec3f91a37c14a2f9f3dea1d8650583566 100644 (file)
@@ -42,8 +42,6 @@ public:
        std::string information () const;
        void as_xml (xmlpp::Node *) const;
 
-       void take_from_audio_examiner (boost::shared_ptr<AudioExaminer>);
-
        static bool valid_file (boost::filesystem::path);
 
 private: