Various fixes to push audio vaguely in the right direction.
[dcpomatic.git] / src / lib / ffmpeg_decoder.cc
index 32903a20eb8995d4a2c2847f3b8b2d10e037afc5..1bae99d6368b5b3f3031ba1450e40d2144a7eda5 100644 (file)
@@ -112,11 +112,10 @@ FFmpegDecoder::flush ()
 
        if (audio) {
                decode_audio_packet ();
-               audio->flush ();
        }
 }
 
-void
+bool
 FFmpegDecoder::pass ()
 {
        int r = av_read_frame (_format_context, &_packet);
@@ -134,7 +133,7 @@ FFmpegDecoder::pass ()
                }
 
                flush ();
-               return;
+               return true;
        }
 
        int const si = _packet.stream_index;
@@ -149,6 +148,7 @@ FFmpegDecoder::pass ()
        }
 
        av_packet_unref (&_packet);
+       return false;
 }
 
 /** @param data pointer to array of pointers to buffers.
@@ -298,6 +298,8 @@ FFmpegDecoder::bytes_per_audio_sample (shared_ptr<FFmpegAudioStream> stream) con
 void
 FFmpegDecoder::seek (ContentTime time, bool accurate)
 {
+       Decoder::seek (time, accurate);
+
        /* If we are doing an `accurate' seek, we need to use pre-roll, as
           we don't really know what the seek will give us.
        */