diff options
-rw-r--r-- | audio/decoders/mp3.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/audio/decoders/mp3.cpp b/audio/decoders/mp3.cpp index 54da6c584d..3fd134df41 100644 --- a/audio/decoders/mp3.cpp +++ b/audio/decoders/mp3.cpp @@ -453,7 +453,10 @@ int PacketizedMP3Stream::readBuffer(int16 *buffer, const int numSamples) { while (samples < numSamples) { // Empty? Bail out for now, and mark the stream as ended if (_queue.empty()) { - _state = MP3_STATE_EOS; + // EOS state is only valid once a packet has been received at least + // once + if (_state == MP3_STATE_READY) + _state = MP3_STATE_EOS; return samples; } |