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
166b490e
Commit
166b490e
authored
Oct 27, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player/Thread: move code to ForwardDecoderError()
parent
efd871ad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
Thread.cxx
src/player/Thread.cxx
+22
-6
No files found.
src/player/Thread.cxx
View file @
166b490e
...
...
@@ -240,6 +240,14 @@ private:
bool
SeekDecoder
();
/**
* Check if the decoder has reported an error, and forward it
* to PlayerControl::SetError().
*
* @return false if an error has occurred
*/
bool
ForwardDecoderError
();
/**
* After the decoder has been started asynchronously, wait for
* the "START" command to finish. The decoder may not be
* initialized yet, i.e. there is no audio_format information
...
...
@@ -345,6 +353,18 @@ Player::StopDecoder()
}
bool
Player
::
ForwardDecoderError
()
{
Error
error
=
dc
.
GetError
();
if
(
error
.
IsDefined
())
{
pc
.
SetError
(
PlayerError
::
DECODER
,
std
::
move
(
error
));
return
false
;
}
return
true
;
}
bool
Player
::
WaitForDecoder
()
{
assert
(
queued
||
pc
.
command
==
PlayerCommand
::
SEEK
);
...
...
@@ -353,10 +373,8 @@ Player::WaitForDecoder()
queued
=
false
;
pc
.
Lock
();
Error
error
=
dc
.
GetError
();
if
(
error
.
IsDefined
())
{
pc
.
SetError
(
PlayerError
::
DECODER
,
std
::
move
(
error
));
if
(
!
ForwardDecoderError
())
{
delete
pc
.
next_song
;
pc
.
next_song
=
nullptr
;
...
...
@@ -457,10 +475,8 @@ Player::CheckDecoderStartup()
pc
.
Lock
();
Error
error
=
dc
.
GetError
();
if
(
error
.
IsDefined
())
{
if
(
!
ForwardDecoderError
())
{
/* the decoder failed */
pc
.
SetError
(
PlayerError
::
DECODER
,
std
::
move
(
error
));
pc
.
Unlock
();
return
false
;
...
...
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