Reinstate AudioDecoder::flush().
authorCarl Hetherington <cth@carlh.net>
Wed, 23 Jul 2014 09:09:08 +0000 (10:09 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 23 Jul 2014 09:09:08 +0000 (10:09 +0100)
src/lib/audio_decoder.cc
src/lib/audio_decoder.h

index 3d5698dfe52a63b21fac0166224d82ec3cc0c71c..e4c82f64c1a7c05d33b7f02fbf043ef5aa93b80a 100644 (file)
@@ -168,6 +168,12 @@ AudioDecoder::audio (shared_ptr<const AudioBuffers> data, ContentTime time)
 
        assert (_audio_position.get() >= (_decoded_audio.frame + _decoded_audio.audio->frames()));
 
+       add (data);
+}
+
+void
+AudioDecoder::add (shared_ptr<const AudioBuffers> data)
+{
        /* Resize _decoded_audio to fit the new data */
        int new_size = 0;
        if (_decoded_audio.audio->frames() == 0) {
@@ -196,7 +202,6 @@ AudioDecoder::audio (shared_ptr<const AudioBuffers> data, ContentTime time)
        }
 }
 
-/* XXX: called? */
 void
 AudioDecoder::flush ()
 {
@@ -204,13 +209,10 @@ AudioDecoder::flush ()
                return;
        }
 
-       /*
        shared_ptr<const AudioBuffers> b = _resampler->flush ();
        if (b) {
-               _pending.push_back (shared_ptr<DecodedAudio> (new DecodedAudio (b, _audio_position.get ())));
-               _audio_position = _audio_position.get() + b->frames ();
+               add (b);
        }
-       */
 }
 
 void
index 045efc00207758d01cb56fce7996d685f1a1b458..750ecd360aa67b705e5b54d730a222ef8fe15455 100644 (file)
@@ -58,6 +58,7 @@ protected:
        void audio (boost::shared_ptr<const AudioBuffers>, ContentTime);
        void flush ();
        void reset_decoded_audio ();
+       void add (boost::shared_ptr<const AudioBuffers>);
 
        boost::shared_ptr<const AudioContent> _audio_content;
        boost::shared_ptr<Resampler> _resampler;