diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-12-19 18:11:23 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-12-19 18:11:23 +1100 |
| commit | 62d51a304eb02f0eab0645488c0b922b4a45e1c9 (patch) | |
| tree | d6dc7013e7db41315fff79807f1e95a996829297 /src/codecs/include | |
| parent | b5d86a9497cdd6b3a27a5c3c9d68993c956143cd (diff) | |
| download | tangara-fw-62d51a304eb02f0eab0645488c0b922b4a45e1c9.tar.gz | |
replace foxenflac with miniflac
it's better!
Diffstat (limited to 'src/codecs/include')
| -rw-r--r-- | src/codecs/include/miniflac.hpp (renamed from src/codecs/include/foxenflac.hpp) | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/codecs/include/foxenflac.hpp b/src/codecs/include/miniflac.hpp index 7522d967..d57b08a3 100644 --- a/src/codecs/include/foxenflac.hpp +++ b/src/codecs/include/miniflac.hpp @@ -6,6 +6,7 @@ #pragma once +#include <sys/_stdint.h> #include <cstddef> #include <cstdint> #include <memory> @@ -13,7 +14,7 @@ #include <string> #include <utility> -#include "foxen/flac.h" +#include "miniflac.h" #include "sample.hpp" #include "source_buffer.hpp" #include "span.hpp" @@ -22,10 +23,10 @@ namespace codecs { -class FoxenFlacDecoder : public ICodec { +class MiniFlacDecoder : public ICodec { public: - FoxenFlacDecoder(); - ~FoxenFlacDecoder(); + MiniFlacDecoder(); + ~MiniFlacDecoder(); auto OpenStream(std::shared_ptr<IStream> input) -> cpp::result<OutputFormat, Error> override; @@ -35,14 +36,16 @@ class FoxenFlacDecoder : public ICodec { auto SeekTo(std::size_t target_sample) -> cpp::result<void, Error> override; - FoxenFlacDecoder(const FoxenFlacDecoder&) = delete; - FoxenFlacDecoder& operator=(const FoxenFlacDecoder&) = delete; + MiniFlacDecoder(const MiniFlacDecoder&) = delete; + MiniFlacDecoder& operator=(const MiniFlacDecoder&) = delete; private: std::shared_ptr<IStream> input_; SourceBuffer buffer_; - fx_flac_t* flac_; + std::unique_ptr<miniflac_t> flac_; + std::array<int32_t*, 2> samples_by_channel_; + std::optional<size_t> current_sample_; }; } // namespace codecs |
