decoder/Control: caller must lock mutex for Stop()
This commit is contained in:
@@ -112,8 +112,6 @@ DecoderControl::Start(std::unique_ptr<DetachedSong> _song,
|
|||||||
void
|
void
|
||||||
DecoderControl::Stop() noexcept
|
DecoderControl::Stop() noexcept
|
||||||
{
|
{
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
|
||||||
|
|
||||||
if (command != DecoderCommand::NONE)
|
if (command != DecoderCommand::NONE)
|
||||||
/* Attempt to cancel the current command. If it's too
|
/* Attempt to cancel the current command. If it's too
|
||||||
late and the decoder thread is already executing
|
late and the decoder thread is already executing
|
||||||
|
@@ -383,6 +383,9 @@ public:
|
|||||||
SongTime start_time, SongTime end_time,
|
SongTime start_time, SongTime end_time,
|
||||||
MusicBuffer &buffer, MusicPipe &pipe) noexcept;
|
MusicBuffer &buffer, MusicPipe &pipe) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Caller must lock the object.
|
||||||
|
*/
|
||||||
void Stop() noexcept;
|
void Stop() noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -373,6 +373,7 @@ void
|
|||||||
Player::StopDecoder() noexcept
|
Player::StopDecoder() noexcept
|
||||||
{
|
{
|
||||||
const PlayerControl::ScopeOccupied occupied(pc);
|
const PlayerControl::ScopeOccupied occupied(pc);
|
||||||
|
const std::lock_guard<Mutex> protect(pc.mutex);
|
||||||
|
|
||||||
dc.Stop();
|
dc.Stop();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user