summaryrefslogtreecommitdiff
path: root/src/lib/audio_decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/audio_decoder.cc')
-rw-r--r--src/lib/audio_decoder.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc
index bd9dff8c9..756192286 100644
--- a/src/lib/audio_decoder.cc
+++ b/src/lib/audio_decoder.cc
@@ -173,6 +173,13 @@ AudioDecoder::audio (shared_ptr<const AudioBuffers> data, ContentTime time)
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) {