player, decoder, output: wrap MusicPipe in std::shared_ptr/std::unique_ptr
This commit is contained in:
@@ -92,16 +92,17 @@ DecoderControl::IsCurrentSong(const DetachedSong &_song) const noexcept
|
||||
void
|
||||
DecoderControl::Start(std::unique_ptr<DetachedSong> _song,
|
||||
SongTime _start_time, SongTime _end_time,
|
||||
MusicBuffer &_buffer, MusicPipe &_pipe) noexcept
|
||||
MusicBuffer &_buffer,
|
||||
std::shared_ptr<MusicPipe> _pipe) noexcept
|
||||
{
|
||||
assert(_song != nullptr);
|
||||
assert(_pipe.IsEmpty());
|
||||
assert(_pipe->IsEmpty());
|
||||
|
||||
song = std::move(_song);
|
||||
start_time = _start_time;
|
||||
end_time = _end_time;
|
||||
buffer = &_buffer;
|
||||
pipe = &_pipe;
|
||||
pipe = std::move(_pipe);
|
||||
|
||||
ClearError();
|
||||
SynchronousCommandLocked(DecoderCommand::START);
|
||||
|
@@ -159,7 +159,7 @@ struct DecoderControl final : InputStreamHandler {
|
||||
* The destination pipe for decoded chunks. The caller thread
|
||||
* owns this object, and is responsible for freeing it.
|
||||
*/
|
||||
MusicPipe *pipe;
|
||||
std::shared_ptr<MusicPipe> pipe;
|
||||
|
||||
const ReplayGainConfig replay_gain_config;
|
||||
ReplayGainMode replay_gain_mode = ReplayGainMode::OFF;
|
||||
@@ -383,7 +383,8 @@ public:
|
||||
*/
|
||||
void Start(std::unique_ptr<DetachedSong> song,
|
||||
SongTime start_time, SongTime end_time,
|
||||
MusicBuffer &buffer, MusicPipe &pipe) noexcept;
|
||||
MusicBuffer &buffer,
|
||||
std::shared_ptr<MusicPipe> pipe) noexcept;
|
||||
|
||||
/**
|
||||
* Caller must lock the object.
|
||||
|
Reference in New Issue
Block a user