fix flac playback. now it plays nice and smooth :)

This commit is contained in:
jacqueline
2023-07-31 10:14:03 +10:00
parent a5022ac6cb
commit 0a8d2fd12e
3 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ static const char* kTag = "SRC";
namespace audio {
static constexpr UINT kFileBufferSize = 4096 * 2;
static constexpr UINT kStreamerBufferSize = 1024;
static constexpr UINT kStreamerBufferSize = 4096;
static StreamBufferHandle_t sForwardDest = nullptr;
+7 -1
View File
@@ -14,6 +14,8 @@
namespace codecs {
static const char kTag[] = "flac";
FoxenFlacDecoder::FoxenFlacDecoder()
: flac_(FX_FLAC_ALLOC(FLAC_MAX_BLOCK_SIZE, 2)) {}
@@ -28,7 +30,11 @@ auto FoxenFlacDecoder::BeginStream(const cpp::span<const std::byte> input)
fx_flac_process(flac_, reinterpret_cast<const uint8_t*>(input.data()),
&bytes_used, NULL, NULL);
if (state != FLAC_END_OF_METADATA) {
return {bytes_used, cpp::fail(Error::kMalformedData)};
if (state == FLAC_ERR) {
return {bytes_used, cpp::fail(Error::kMalformedData)};
} else {
return {bytes_used, cpp::fail(Error::kOutOfInput)};
}
}
int64_t channels = fx_flac_get_streaminfo(flac_, FLAC_KEY_N_CHANNELS);
+1 -1
View File
@@ -106,7 +106,7 @@ auto Priority() -> UBaseType_t;
// highest priority.
template <>
auto Priority<Type::kAudio>() -> UBaseType_t {
return 10;
return 11;
}
// After audio issues, UI jank is the most noticeable kind of scheduling-induced
// slowness that the user is likely to notice or care about. Therefore we place