diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-07-28 23:48:12 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-07-28 23:48:12 +0200 |
| commit | 9281427e96ebda9dc6aa7b85ad1e5c5ad96ed837 (patch) | |
| tree | 100844b5354947085ca4f56415434120b4007044 | |
| parent | 8998c8bb78e1cb0858d7d61fb03146b4284a577e (diff) | |
Cleanup: remove another shared_ptr use.
| -rw-r--r-- | src/frame.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/frame.h b/src/frame.h index 01dfe8b4..d49be8f1 100644 --- a/src/frame.h +++ b/src/frame.h @@ -55,11 +55,9 @@ class Frame { public: Frame (R* reader, int n, std::shared_ptr<const DecryptionContext> c, bool check_hmac) + : _buffer(Kumu::Megabyte) { - /* XXX: unfortunate guesswork on this buffer size */ - _buffer = std::make_shared<B>(Kumu::Megabyte); - - if (ASDCP_FAILURE(reader->ReadFrame(n, *_buffer, c->context(), check_hmac ? c->hmac() : nullptr))) { + if (ASDCP_FAILURE(reader->ReadFrame(n, _buffer, c->context(), check_hmac ? c->hmac() : nullptr))) { boost::throw_exception (ReadError ("could not read frame")); } } @@ -69,16 +67,16 @@ public: uint8_t const * data () const { - return _buffer->RoData (); + return _buffer.RoData(); } int size () const { - return _buffer->Size (); + return _buffer.Size(); } private: - std::shared_ptr<B> _buffer; + B _buffer; }; |
