From: Carl Hetherington Date: Wed, 23 Jul 2014 09:09:08 +0000 (+0100) Subject: Reinstate AudioDecoder::flush(). X-Git-Tag: v2.0.48~677 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=93d6bd98279b2c912daffa2c91484121085d8dca;p=dcpomatic.git Reinstate AudioDecoder::flush(). --- 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;