Some more decode logging.
[dcpomatic.git] / src / lib / audio_decoder.cc
index fa9fe9711f2cf91692b1d3d140b7a799900240ed..f26c676b200038c54673871ef2b80c42ee8d8adb 100644 (file)
@@ -23,7 +23,6 @@
 #include "audio_decoder_stream.h"
 #include "audio_content.h"
 #include <boost/foreach.hpp>
-#include <boost/make_shared.hpp>
 #include <iostream>
 
 #include "i18n.h"
 using std::cout;
 using std::map;
 using boost::shared_ptr;
-using boost::make_shared;
 
-AudioDecoder::AudioDecoder (Decoder* parent, shared_ptr<const AudioContent> content, bool fast, shared_ptr<Log> log)
-       : _ignore (false)
-       , _fast (fast)
+AudioDecoder::AudioDecoder (Decoder* parent, shared_ptr<const AudioContent> content, shared_ptr<Log> log)
+       : DecoderPart (parent, log)
 {
        BOOST_FOREACH (AudioStreamPtr i, content->streams ()) {
-               _streams[i] = make_shared<AudioDecoderStream> (content, i, parent, fast, log);
+               _streams[i] = shared_ptr<AudioDecoderStream> (new AudioDecoderStream (content, i, parent, this, log));
        }
 }
 
@@ -51,7 +48,7 @@ AudioDecoder::get (AudioStreamPtr stream, Frame frame, Frame length, bool accura
 void
 AudioDecoder::give (AudioStreamPtr stream, shared_ptr<const AudioBuffers> data, ContentTime time)
 {
-       if (_ignore) {
+       if (ignore ()) {
                return;
        }
 
@@ -97,9 +94,10 @@ AudioDecoder::seek (ContentTime t, bool accurate)
        }
 }
 
-/** Set this decoder never to produce any data */
 void
-AudioDecoder::set_ignore ()
+AudioDecoder::set_fast ()
 {
-       _ignore = true;
+       for (map<AudioStreamPtr, shared_ptr<AudioDecoderStream> >::const_iterator i = _streams.begin(); i != _streams.end(); ++i) {
+               i->second->set_fast ();
+       }
 }