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
4ee147ea
Commit
4ee147ea
authored
Nov 13, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DecoderAPI: stop decoder on MPD error
This commit adds the basic infrastructure for reporting bugs from DecoderAPI.cxx via DecoderThread.cxx to DecoderControl.
parent
f1ca61d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
DecoderAPI.cxx
src/DecoderAPI.cxx
+4
-0
DecoderInternal.hxx
src/DecoderInternal.hxx
+7
-0
DecoderThread.cxx
src/DecoderThread.cxx
+6
-1
No files found.
src/DecoderAPI.cxx
View file @
4ee147ea
...
...
@@ -134,6 +134,10 @@ gcc_pure
static
DecoderCommand
decoder_get_virtual_command
(
Decoder
&
decoder
)
{
if
(
decoder
.
error
.
IsDefined
())
/* an error has occurred: stop the decoder plugin */
return
DecoderCommand
::
STOP
;
const
DecoderControl
&
dc
=
decoder
.
dc
;
assert
(
dc
.
pipe
!=
nullptr
);
...
...
src/DecoderInternal.hxx
View file @
4ee147ea
...
...
@@ -22,6 +22,7 @@
#include "DecoderCommand.hxx"
#include "ReplayGainInfo.hxx"
#include "util/Error.hxx"
class
PcmConvert
;
struct
DecoderControl
;
...
...
@@ -87,6 +88,12 @@ struct Decoder {
*/
unsigned
replay_gain_serial
;
/**
* An error has occurred (in DecoderAPI.cxx), and the plugin
* will be asked to stop.
*/
Error
error
;
Decoder
(
DecoderControl
&
_dc
,
bool
_initial_seek_pending
,
Tag
*
_tag
)
:
dc
(
_dc
),
convert
(
nullptr
),
...
...
src/DecoderThread.cxx
View file @
4ee147ea
...
...
@@ -360,7 +360,12 @@ decoder_run_song(DecoderControl &dc,
dc
.
Lock
();
if
(
ret
)
if
(
decoder
.
error
.
IsDefined
())
{
/* copy the Error from sruct Decoder to
DecoderControl */
dc
.
state
=
DecoderState
::
ERROR
;
dc
.
error
=
std
::
move
(
decoder
.
error
);
}
else
if
(
ret
)
dc
.
state
=
DecoderState
::
STOP
;
else
{
dc
.
state
=
DecoderState
::
ERROR
;
...
...
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