1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:57:44 +00:00

Audio: Fix code smells and issues found by static analysis

This fixes all current code smells, bugs and issues reported by
SonarCloud static analysis. Other issues are almost exclusively false
positives. This makes much code clearer, and some minor benefits in
performance or bug evasion may be gained.
This commit is contained in:
kleines Filmröllchen 2021-11-15 22:27:28 +01:00 committed by Linus Groh
parent a757f3f421
commit 8af97d0ce7
12 changed files with 99 additions and 77 deletions

View file

@ -69,8 +69,8 @@ ALWAYS_INLINE i32 decode_unsigned_exp_golomb(u8 order, InputBitStream& bit_input
class FlacLoaderPlugin : public LoaderPlugin {
public:
FlacLoaderPlugin(StringView path);
FlacLoaderPlugin(const ByteBuffer& buffer);
explicit FlacLoaderPlugin(StringView path);
explicit FlacLoaderPlugin(const ByteBuffer& buffer);
~FlacLoaderPlugin()
{
if (m_stream)
@ -87,8 +87,8 @@ public:
virtual void reset() override;
virtual void seek(const int position) override;
virtual int loaded_samples() override { return m_loaded_samples; }
virtual int total_samples() override { return m_total_samples; }
virtual int loaded_samples() override { return static_cast<int>(m_loaded_samples); }
virtual int total_samples() override { return static_cast<int>(m_total_samples); }
virtual u32 sample_rate() override { return m_sample_rate; }
virtual u16 num_channels() override { return m_num_channels; }
virtual PcmSampleFormat pcm_format() override { return m_sample_format; }