From 93d6bd98279b2c912daffa2c91484121085d8dca Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 23 Jul 2014 10:09:08 +0100 Subject: [PATCH] Reinstate AudioDecoder::flush(). --- src/lib/audio_decoder.cc | 12 +++++++----- src/lib/audio_decoder.h | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index 3d5698dfe..e4c82f64c 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -168,6 +168,12 @@ AudioDecoder::audio (shared_ptr data, ContentTime time) assert (_audio_position.get() >= (_decoded_audio.frame + _decoded_audio.audio->frames())); + add (data); +} + +void +AudioDecoder::add (shared_ptr 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 data, ContentTime time) } } -/* XXX: called? */ void AudioDecoder::flush () { @@ -204,13 +209,10 @@ AudioDecoder::flush () return; } - /* shared_ptr b = _resampler->flush (); if (b) { - _pending.push_back (shared_ptr (new DecodedAudio (b, _audio_position.get ()))); - _audio_position = _audio_position.get() + b->frames (); + add (b); } - */ } void diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index 045efc002..750ecd360 100644 --- a/src/lib/audio_decoder.h +++ b/src/lib/audio_decoder.h @@ -58,6 +58,7 @@ protected: void audio (boost::shared_ptr, ContentTime); void flush (); void reset_decoded_audio (); + void add (boost::shared_ptr); boost::shared_ptr _audio_content; boost::shared_ptr _resampler; -- 2.30.2