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
baa2bc0c
Commit
baa2bc0c
authored
Dec 14, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player/Control: add method LockSetOutputError()
parent
7e1b5348
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
Control.hxx
src/player/Control.hxx
+16
-0
Thread.cxx
src/player/Thread.cxx
+2
-10
No files found.
src/player/Control.hxx
View file @
baa2bc0c
...
@@ -370,6 +370,22 @@ public:
...
@@ -370,6 +370,22 @@ public:
void
SetError
(
PlayerError
type
,
std
::
exception_ptr
&&
_error
);
void
SetError
(
PlayerError
type
,
std
::
exception_ptr
&&
_error
);
/**
/**
* Set the error and set state to PlayerState::PAUSE.
*/
void
SetOutputError
(
std
::
exception_ptr
&&
_error
)
{
SetError
(
PlayerError
::
OUTPUT
,
std
::
move
(
_error
));
/* pause: the user may resume playback as soon as an
audio output becomes available */
state
=
PlayerState
::
PAUSE
;
}
void
LockSetOutputError
(
std
::
exception_ptr
&&
_error
)
{
const
ScopeLock
lock
(
mutex
);
SetOutputError
(
std
::
move
(
_error
));
}
/**
* Checks whether an error has occurred, and if so, rethrows
* Checks whether an error has occurred, and if so, rethrows
* it.
* it.
*
*
...
...
src/player/Thread.cxx
View file @
baa2bc0c
...
@@ -461,10 +461,7 @@ Player::OpenOutput()
...
@@ -461,10 +461,7 @@ Player::OpenOutput()
audio output becomes available */
audio output becomes available */
paused
=
true
;
paused
=
true
;
pc
.
Lock
();
pc
.
LockSetOutputError
(
std
::
current_exception
());
pc
.
SetError
(
PlayerError
::
OUTPUT
,
std
::
current_exception
());
pc
.
state
=
PlayerState
::
PAUSE
;
pc
.
Unlock
();
idle_add
(
IDLE_PLAYER
);
idle_add
(
IDLE_PLAYER
);
...
@@ -911,16 +908,11 @@ Player::PlayNextChunk()
...
@@ -911,16 +908,11 @@ Player::PlayNextChunk()
buffer
.
Return
(
chunk
);
buffer
.
Return
(
chunk
);
pc
.
Lock
();
pc
.
SetError
(
PlayerError
::
OUTPUT
,
std
::
current_exception
());
/* pause: the user may resume playback as soon as an
/* pause: the user may resume playback as soon as an
audio output becomes available */
audio output becomes available */
pc
.
state
=
PlayerState
::
PAUSE
;
paused
=
true
;
paused
=
true
;
pc
.
Unlock
(
);
pc
.
LockSetOutputError
(
std
::
current_exception
()
);
idle_add
(
IDLE_PLAYER
);
idle_add
(
IDLE_PLAYER
);
...
...
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