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
a5b8d791
Commit
a5b8d791
authored
Dec 14, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player/Thread: mutex must be locked inside OpenOutput()
parent
d0e735ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
Thread.cxx
src/player/Thread.cxx
+7
-9
No files found.
src/player/Thread.cxx
View file @
a5b8d791
...
...
@@ -297,6 +297,8 @@ private:
* Wrapper for MultipleOutputs::Open(). Upon failure, it
* pauses the player.
*
* Caller must lock the mutex.
*
* @return true on success
*/
bool
OpenOutput
();
...
...
@@ -457,6 +459,7 @@ Player::OpenOutput()
pc
.
state
==
PlayerState
::
PAUSE
);
try
{
const
ScopeUnlock
unlock
(
pc
.
mutex
);
pc
.
outputs
.
Open
(
play_audio_format
,
buffer
);
}
catch
(
const
std
::
runtime_error
&
e
)
{
LogError
(
e
);
...
...
@@ -467,7 +470,7 @@ Player::OpenOutput()
audio output becomes available */
paused
=
true
;
pc
.
Lock
SetOutputError
(
std
::
current_exception
());
pc
.
SetOutputError
(
std
::
current_exception
());
idle_add
(
IDLE_PLAYER
);
...
...
@@ -477,10 +480,7 @@ Player::OpenOutput()
output_open
=
true
;
paused
=
false
;
{
const
ScopeLock
lock
(
pc
.
mutex
);
pc
.
state
=
PlayerState
::
PLAY
;
}
pc
.
state
=
PlayerState
::
PLAY
;
idle_add
(
IDLE_PLAYER
);
...
...
@@ -510,8 +510,6 @@ Player::CheckDecoderStartup()
play_audio_format
=
dc
.
out_audio_format
;
decoder_starting
=
false
;
const
ScopeUnlock
unlock
(
pc
.
mutex
);
idle_add
(
IDLE_PLAYER
);
if
(
!
paused
&&
!
OpenOutput
())
{
...
...
@@ -698,9 +696,9 @@ Player::ProcessCommand()
pc
.
state
=
PlayerState
::
PLAY
;
}
else
{
OpenOutput
();
pc
.
Lock
();
OpenOutput
();
}
pc
.
CommandFinished
();
...
...
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