MusicChunk, player/Thread: use std::unique_ptr<Tag>

This commit is contained in:
Max Kellermann
2017-12-20 14:43:29 +01:00
parent c6a95395b5
commit 25fa3ccade
7 changed files with 21 additions and 30 deletions

View File

@@ -28,6 +28,8 @@
#include "AudioFormat.hxx"
#endif
#include <memory>
#include <stdint.h>
#include <stddef.h>
@@ -67,11 +69,9 @@ struct MusicChunk {
/**
* An optional tag associated with this chunk (and the
* following chunks); appears at song boundaries. The tag
* object is owned by this chunk, and must be freed when this
* chunk is deinitialized.
* following chunks); appears at song boundaries.
*/
Tag *tag = nullptr;
std::unique_ptr<Tag> tag;
/**
* Replay gain information associated with this chunk.
@@ -101,12 +101,10 @@ struct MusicChunk {
AudioFormat audio_format;
#endif
MusicChunk() = default;
MusicChunk() noexcept;
~MusicChunk() noexcept;
MusicChunk(const MusicChunk &) = delete;
~MusicChunk();
MusicChunk &operator=(const MusicChunk &) = delete;
bool IsEmpty() const {