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
0709878b
Commit
0709878b
authored
May 13, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/API: add class StopDecoder
parent
662e4770
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
DecoderAPI.hxx
src/decoder/DecoderAPI.hxx
+7
-0
DecoderThread.cxx
src/decoder/DecoderThread.cxx
+2
-0
OpusDecoderPlugin.cxx
src/decoder/plugins/OpusDecoderPlugin.cxx
+1
-1
No files found.
src/decoder/DecoderAPI.hxx
View file @
0709878b
...
...
@@ -47,6 +47,13 @@
class
Error
;
/**
* Throw an instance of this class to stop decoding the current song
* (successfully). It can be used to jump out of all of a decoder's
* stack frames.
*/
class
StopDecoder
{};
/**
* Notify the player thread that it has finished initialization and
* that it has read the song's meta data.
*
...
...
src/decoder/DecoderThread.cxx
View file @
0709878b
...
...
@@ -356,6 +356,8 @@ try {
return
!
path_fs
.
IsNull
()
?
decoder_run_file
(
decoder
,
real_uri
,
path_fs
)
:
decoder_run_stream
(
decoder
,
real_uri
);
}
catch
(
StopDecoder
)
{
return
true
;
}
catch
(
const
std
::
runtime_error
&
e
)
{
/* copy the exception to decoder.error */
...
...
src/decoder/plugins/OpusDecoderPlugin.cxx
View file @
0709878b
...
...
@@ -310,7 +310,7 @@ MPDOpusDecoder::HandleEOS()
return
decoder_get_command
(
decoder
);
}
return
DecoderCommand
::
STOP
;
throw
StopDecoder
()
;
}
inline
DecoderCommand
...
...
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