Merge master.
[dcpomatic.git] / src / lib / audio_decoder.cc
index e4c82f64c1a7c05d33b7f02fbf043ef5aa93b80a..12580c5f64972fd64498697e1f5dce7b4635af3d 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "i18n.h"
 
-using std::stringstream;
 using std::list;
 using std::pair;
 using std::cout;
@@ -80,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 */
        }