From 40130527c0fd8010a94d2937c4c317eecd5b231e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 5 Apr 2017 23:30:20 +0100 Subject: [PATCH] Fix off-by-one which could cause AudioDecoderStream::get not to fetch enough data to satisfy the request, causing dropouts in the written audio. --- ChangeLog | 4 ++++ src/lib/audio_decoder_stream.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 377e089a2..40096c2f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-04-05 Carl Hetherington + + * Fix single-sample dropouts in audio in some circumstances. + 2016-12-11 Carl Hetherington * Version 2.10.2 released. diff --git a/src/lib/audio_decoder_stream.cc b/src/lib/audio_decoder_stream.cc index b7b96ddd4..82e087789 100644 --- a/src/lib/audio_decoder_stream.cc +++ b/src/lib/audio_decoder_stream.cc @@ -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. -- 2.30.2