summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2024-07-22 16:04:20 +1000
committerailurux <ailuruxx@gmail.com>2024-07-22 16:04:20 +1000
commita440d71bef42a2c9cc10d9f3f49fa097257d25f9 (patch)
tree00dd09a8c0834f5700f401792f6cf9d745a3f23e
parent6f98eaf85e9ab9d6251c0cf12807b04a6674767d (diff)
downloadtangara-fw-a440d71bef42a2c9cc10d9f3f49fa097257d25f9.tar.gz
Continue decoding even if OV_HOLE is returned
-rw-r--r--src/codecs/vorbis.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/codecs/vorbis.cpp b/src/codecs/vorbis.cpp
index 0b2af691..ea33a2af 100644
--- a/src/codecs/vorbis.cpp
+++ b/src/codecs/vorbis.cpp
@@ -137,10 +137,15 @@ auto TremorVorbisDecoder::DecodeTo(std::span<sample::Sample> output)
((output.size() - 1) * sizeof(sample::Sample)), &unused);
if (bytes_written == OV_HOLE) {
ESP_LOGE(kTag, "got OV_HOLE");
- return cpp::fail(Error::kMalformedData);
+ return OutputInfo{
+ .samples_written = 0,
+ .is_stream_finished = false,
+ };
} else if (bytes_written == OV_EBADLINK) {
ESP_LOGE(kTag, "got OV_EBADLINK");
return cpp::fail(Error::kMalformedData);
+ } else if (bytes_written == OV_EINVAL) {
+ return cpp::fail(Error::kMalformedData);
}
return OutputInfo{