Fix off-by-one which could cause AudioDecoderStream::get not to
authorCarl Hetherington <cth@carlh.net>
Wed, 5 Apr 2017 22:30:20 +0000 (23:30 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 5 Apr 2017 22:30:20 +0000 (23:30 +0100)
fetch enough data to satisfy the request, causing dropouts in the
written audio.

ChangeLog
src/lib/audio_decoder_stream.cc

index 377e089a2a0ae9e912aaabc23c1442081cfe9762..40096c2f42ff19a567ccc66825c2eb428fae748f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-04-05  Carl Hetherington  <cth@carlh.net>
+
+       * Fix single-sample dropouts in audio in some circumstances.
+
 2016-12-11  Carl Hetherington  <cth@carlh.net>
 
        * Version 2.10.2 released.
index b7b96ddd4ad88e17b2b03057559f283a04e617da..82e087789bf92e85b1cb053ca23df4daec2582a0 100644 (file)
@@ -70,7 +70,7 @@ AudioDecoderStream::get (Frame frame, Frame length, bool accurate)
 
        _log->log (String::compose ("-> ADS has request for %1 %2", frame, length), LogEntry::TYPE_DEBUG_DECODE);
 
-       Frame const end = frame + length - 1;
+       Frame const end = frame + length;
 
        /* If we are less than (about) 5 seconds behind the data that we want we'll
           run through it rather than seeking.