From 33e0b0ee0d70db7b8866a6a72d7691d1a29f3e00 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 10 Sep 2014 00:51:31 +0100 Subject: Don't automatically call pass() without first checking to see if we have what we need; otherwise we can keep calling pass() unnecessarily which causes a build-up of data which is eventually trimmed to save memory. --- src/lib/audio_decoder.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index f425cf280..12580c5f6 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -79,10 +79,10 @@ AudioDecoder::get_audio (AudioFrame frame, AudioFrame length, bool accurate) */ if (accurate) { /* Keep stuffing data into _decoded_audio until we have enough data, or the subclass does not want to give us any more */ - while (!pass() && (_decoded_audio.frame > frame || (_decoded_audio.frame + _decoded_audio.audio->frames()) < end)) {} + while (_decoded_audio.frame > frame || (_decoded_audio.frame + _decoded_audio.audio->frames()) < end && !pass ()) {} decoded_offset = frame - _decoded_audio.frame; } else { - while (!pass() && _decoded_audio.audio->frames() < length) {} + while (_decoded_audio.audio->frames() < length && !pass ()) {} /* Use decoded_offset of 0, as we don't really care what frames we return */ } -- cgit v1.2.3