Some more decode logging.
[dcpomatic.git] / src / lib / audio_decoder_stream.cc
index 7e8e304ef63e83e4d44d9556dfe9ee2f4a0eb969..ef67b94f17e606144230d35a417911fdacee87b1 100644 (file)
@@ -40,10 +40,13 @@ using std::max;
 using boost::optional;
 using boost::shared_ptr;
 
-AudioDecoderStream::AudioDecoderStream (shared_ptr<const AudioContent> content, AudioStreamPtr stream, Decoder* decoder, shared_ptr<Log> log)
+AudioDecoderStream::AudioDecoderStream (
+       shared_ptr<const AudioContent> content, AudioStreamPtr stream, Decoder* decoder, AudioDecoder* audio_decoder, shared_ptr<Log> log
+       )
        : _content (content)
        , _stream (stream)
        , _decoder (decoder)
+       , _audio_decoder (audio_decoder)
        , _log (log)
          /* We effectively start having done a seek to zero; this allows silence-padding of the first
             data that comes out of our decoder.
@@ -68,7 +71,7 @@ AudioDecoderStream::get (Frame frame, Frame length, bool accurate)
 {
        shared_ptr<ContentAudio> dec;
 
-       _log->log (String::compose ("-> ADS has request for %1 %2", frame, length), LogEntry::TYPE_DEBUG_DECODE);
+       _log->log (String::compose ("ADS has request for %1 %2", frame, length), LogEntry::TYPE_DEBUG_DECODE);
 
        Frame const from = frame;
        Frame const to = from + length;
@@ -86,7 +89,8 @@ AudioDecoderStream::get (Frame frame, Frame length, bool accurate)
        }
 
        if (missing) {
-               _decoder->maybe_seek_audio (ContentTime::from_frames (*missing, _content->resampled_frame_rate()), accurate);
+               _log->log (String::compose ("ADS suggests seek to %1", *missing), LogEntry::TYPE_DEBUG_DECODE);
+               _audio_decoder->maybe_seek (ContentTime::from_frames (*missing, _content->resampled_frame_rate()), accurate);
        }
 
        /* Offset of the data that we want from the start of _decoded.audio