Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
505d0bfa
Commit
505d0bfa
authored
Dec 22, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player/Thread: move mutex lock out of StopDecoder()
parent
860d13c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Thread.cxx
src/player/Thread.cxx
+8
-8
No files found.
src/player/Thread.cxx
View file @
505d0bfa
...
...
@@ -239,7 +239,7 @@ private:
/**
* Stop the decoder and clears (and frees) its music pipe.
*
*
Player lock is not held
.
*
Caller must lock the mutex
.
*/
void
StopDecoder
()
noexcept
;
...
...
@@ -373,7 +373,6 @@ void
Player
::
StopDecoder
()
noexcept
{
const
PlayerControl
::
ScopeOccupied
occupied
(
pc
);
const
std
::
lock_guard
<
Mutex
>
protect
(
pc
.
mutex
);
dc
.
Stop
();
...
...
@@ -592,7 +591,10 @@ Player::SeekDecoder() noexcept
/* the decoder is already decoding the "next" song -
stop it and start the previous song again */
StopDecoder
();
{
const
std
::
lock_guard
<
Mutex
>
lock
(
pc
.
mutex
);
StopDecoder
();
}
/* clear music chunks which might still reside in the
pipe */
...
...
@@ -727,12 +729,10 @@ Player::ProcessCommand() noexcept
return
;
}
if
(
IsDecoderAtNextSong
())
{
if
(
IsDecoderAtNextSong
())
/* the decoder is already decoding the song -
stop it and reset the position */
const
ScopeUnlock
unlock
(
pc
.
mutex
);
StopDecoder
();
}
pc
.
next_song
.
reset
();
queued
=
false
;
...
...
@@ -1120,6 +1120,8 @@ Player::Run() noexcept
pc
.
Lock
();
}
const
std
::
lock_guard
<
Mutex
>
lock
(
pc
.
mutex
);
StopDecoder
();
ClearAndDeletePipe
();
...
...
@@ -1131,8 +1133,6 @@ Player::Run() noexcept
song
.
reset
();
}
const
std
::
lock_guard
<
Mutex
>
lock
(
pc
.
mutex
);
pc
.
ClearTaggedSong
();
if
(
queued
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment