*/
+#include <iostream>
#include "audio_decoder.h"
#include "audio_buffers.h"
#include "audio_processor.h"
*/
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 (_decoded_audio.frame > frame || (_decoded_audio.frame + _decoded_audio.audio->frames()) < end && !pass ()) {}
+ while ((_decoded_audio.frame > frame || (_decoded_audio.frame + _decoded_audio.audio->frames()) < end) && !pass ()) {}
decoded_offset = frame - _decoded_audio.frame;
} else {
while (_decoded_audio.audio->frames() < length && !pass ()) {}
void
AudioDecoder::add (shared_ptr<const AudioBuffers> data)
{
+ if (!_audio_position) {
+ /* This should only happen when there is a seek followed by a flush, but
+ we need to cope with it.
+ */
+ return;
+ }
+
/* Resize _decoded_audio to fit the new data */
int new_size = 0;
if (_decoded_audio.audio->frames() == 0) {