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
4bcc38c7
Commit
4bcc38c7
authored
Dec 22, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player/Thread: move mutex lock out of WaitDecoderStartup()
parent
5becffbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
Thread.cxx
src/player/Thread.cxx
+9
-4
No files found.
src/player/Thread.cxx
View file @
4bcc38c7
...
...
@@ -208,11 +208,11 @@ private:
* This method does not check for commands. It is only
* allowed to be used while a command is being handled.
*
* Caller must lock the mutex.
*
* @return false if the decoder has failed
*/
bool
WaitDecoderStartup
()
noexcept
{
const
std
::
lock_guard
<
Mutex
>
lock
(
pc
.
mutex
);
while
(
decoder_starting
)
{
if
(
!
CheckDecoderStartup
())
{
/* if decoder startup fails, make sure
...
...
@@ -231,6 +231,11 @@ private:
return
true
;
}
bool
LockWaitDecoderStartup
()
noexcept
{
const
std
::
lock_guard
<
Mutex
>
lock
(
pc
.
mutex
);
return
WaitDecoderStartup
();
}
/**
* Stop the decoder and clears (and frees) its music pipe.
*
...
...
@@ -596,7 +601,7 @@ Player::SeekDecoder() noexcept
StartDecoder
(
*
pipe
);
ActivateDecoder
();
if
(
!
WaitDecoderStartup
())
if
(
!
Lock
WaitDecoderStartup
())
return
false
;
}
else
{
if
(
!
IsDecoderAtCurrentSong
())
{
...
...
@@ -613,7 +618,7 @@ Player::SeekDecoder() noexcept
(just in case that happens to be still in
progress) */
if
(
!
WaitDecoderStartup
())
if
(
!
Lock
WaitDecoderStartup
())
return
false
;
/* send the SEEK command */
...
...
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