Basic template support (#485).
[dcpomatic.git] / src / lib / audio_decoder_stream.cc
index bdcef598d8f68c551597175c0bcd5418d01c9432..b7b96ddd4ad88e17b2b03057559f283a04e617da 100644 (file)
@@ -45,6 +45,10 @@ AudioDecoderStream::AudioDecoderStream (shared_ptr<const AudioContent> content,
        , _stream (stream)
        , _decoder (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.
+         */
+       , _seek_reference (ContentTime ())
 {
        if (content->resampled_frame_rate() != _stream->frame_rate() && _stream->channels() > 0) {
                _resampler.reset (new Resampler (_stream->frame_rate(), content->resampled_frame_rate(), _stream->channels ()));
@@ -149,7 +153,7 @@ AudioDecoderStream::get (Frame frame, Frame length, bool accurate)
 void
 AudioDecoderStream::audio (shared_ptr<const AudioBuffers> data, ContentTime time)
 {
-       _log->log (String::compose ("ADS receives %1 %2", time, data->frames ()), LogEntry::TYPE_DEBUG_DECODE);
+       _log->log (String::compose ("ADS receives %1 %2", to_string(time), data->frames ()), LogEntry::TYPE_DEBUG_DECODE);
 
        if (_resampler) {
                data = _resampler->run (data);