Logging improvements to allow prettier displays in the server GUI.
[dcpomatic.git] / src / lib / audio_decoder.cc
index a65e5f7594eaf804bcd6b140293ac303e8dcead0..2944357bac7fe0f279bb8da163915c1e730f65e9 100644 (file)
@@ -30,8 +30,10 @@ using std::cout;
 using std::map;
 using boost::shared_ptr;
 
-AudioDecoder::AudioDecoder (shared_ptr<const AudioContent> content)
+AudioDecoder::AudioDecoder (shared_ptr<const AudioContent> content, bool fast)
        : _audio_content (content)
+       , _ignore_audio (false)
+       , _fast (fast)
 {
        BOOST_FOREACH (AudioStreamPtr i, content->audio_streams ()) {
                _streams[i] = shared_ptr<AudioDecoderStream> (new AudioDecoderStream (_audio_content, i, this));
@@ -47,6 +49,10 @@ AudioDecoder::get_audio (AudioStreamPtr stream, Frame frame, Frame length, bool
 void
 AudioDecoder::audio (AudioStreamPtr stream, shared_ptr<const AudioBuffers> data, ContentTime time)
 {
+       if (_ignore_audio) {
+               return;
+       }
+
        if (_streams.find (stream) == _streams.end ()) {
 
                /* This method can be called with an unknown stream during the following sequence:
@@ -88,3 +94,10 @@ AudioDecoder::seek (ContentTime t, bool accurate)
                i->second->seek (t, accurate);
        }
 }
+
+/** Set this player never to produce any audio data */
+void
+AudioDecoder::set_ignore_audio ()
+{
+       _ignore_audio = true;
+}