1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:37:46 +00:00

LibAudio: Expand FLAC loader debug messages

These are now indented to aid readability.
This commit is contained in:
kleines Filmröllchen 2023-07-05 00:05:56 +02:00 committed by Andrew Kaster
parent 60f1472902
commit 252b1328ea

View file

@ -833,7 +833,7 @@ ErrorOr<Vector<i64>, LoaderError> FlacLoaderPlugin::decode_fixed_lpc(FlacSubfram
TRY(decode_residual(decoded, subframe, bit_input)); TRY(decode_residual(decoded, subframe, bit_input));
dbgln_if(AFLACLOADER_DEBUG, "decoded length {}, {} order predictor", decoded.size(), subframe.order); dbgln_if(AFLACLOADER_DEBUG, " decoded length {}, {} order predictor, now at file offset {:x}", decoded.size(), subframe.order, TRY(m_stream->tell()));
// Skip these comments if you don't care about the neat math behind fixed LPC :^) // Skip these comments if you don't care about the neat math behind fixed LPC :^)
// These coefficients for the recursive prediction formula are the only ones that can be resolved to polynomial predictor functions. // These coefficients for the recursive prediction formula are the only ones that can be resolved to polynomial predictor functions.
@ -893,6 +893,8 @@ MaybeLoaderError FlacLoaderPlugin::decode_residual(Vector<i64>& decoded, FlacSub
u8 partition_order = TRY(bit_input.read_bits<u8>(4)); u8 partition_order = TRY(bit_input.read_bits<u8>(4));
size_t partitions = 1 << partition_order; size_t partitions = 1 << partition_order;
dbgln_if(AFLACLOADER_DEBUG, " {}-bit Rice partitions, {} total (order {})", residual_mode == FlacResidualMode::Rice4Bit ? "4"sv : "5"sv, partitions, partition_order);
if (partitions > m_current_frame->sample_count) if (partitions > m_current_frame->sample_count)
return LoaderError { LoaderError::Category::Format, static_cast<size_t>(m_current_sample_or_frame), "Too many Rice partitions, each partition must contain at least one sample" }; return LoaderError { LoaderError::Category::Format, static_cast<size_t>(m_current_sample_or_frame), "Too many Rice partitions, each partition must contain at least one sample" };