Continue decoding even if OV_HOLE is returned

custom
ailurux 9 months ago
parent 6f98eaf85e
commit a440d71bef
  1. 7
      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{

Loading…
Cancel
Save