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
d8aec4b2
Commit
d8aec4b2
authored
Jul 12, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/run_decoder: catch StopDecoder
This exception is usually thrown by class DecoderBridge, but the Opus plugin (ab)uses it as well, so we need to catch it.
parent
39b302dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
RunChromaprint.cxx
test/RunChromaprint.cxx
+9
-3
run_decoder.cxx
test/run_decoder.cxx
+9
-2
No files found.
test/RunChromaprint.cxx
View file @
d8aec4b2
...
...
@@ -23,7 +23,7 @@
#include "event/Thread.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "decoder/
Client.hxx"
#include "decoder/
DecoderAPI.hxx"
/* for class StopDecoder */
#include "input/Init.hxx"
#include "input/InputStream.hxx"
#include "fs/Path.hxx"
...
...
@@ -244,10 +244,16 @@ try {
ChromaprintDecoderClient
client
;
if
(
plugin
->
file_decode
!=
nullptr
)
{
plugin
->
FileDecode
(
client
,
Path
::
FromFS
(
c
.
uri
));
try
{
plugin
->
FileDecode
(
client
,
Path
::
FromFS
(
c
.
uri
));
}
catch
(
StopDecoder
)
{
}
}
else
if
(
plugin
->
stream_decode
!=
nullptr
)
{
auto
is
=
InputStream
::
OpenReady
(
c
.
uri
,
client
.
mutex
);
plugin
->
StreamDecode
(
client
,
*
is
);
try
{
plugin
->
StreamDecode
(
client
,
*
is
);
}
catch
(
StopDecoder
)
{
}
}
else
{
fprintf
(
stderr
,
"Decoder plugin is not usable
\n
"
);
return
EXIT_FAILURE
;
...
...
test/run_decoder.cxx
View file @
d8aec4b2
...
...
@@ -21,6 +21,7 @@
#include "event/Thread.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "decoder/DecoderAPI.hxx"
/* for class StopDecoder */
#include "DumpDecoderClient.hxx"
#include "input/Init.hxx"
#include "input/InputStream.hxx"
...
...
@@ -116,10 +117,16 @@ try {
DumpDecoderClient
client
;
if
(
plugin
->
file_decode
!=
nullptr
)
{
plugin
->
FileDecode
(
client
,
Path
::
FromFS
(
c
.
uri
));
try
{
plugin
->
FileDecode
(
client
,
Path
::
FromFS
(
c
.
uri
));
}
catch
(
StopDecoder
)
{
}
}
else
if
(
plugin
->
stream_decode
!=
nullptr
)
{
auto
is
=
InputStream
::
OpenReady
(
c
.
uri
,
client
.
mutex
);
plugin
->
StreamDecode
(
client
,
*
is
);
try
{
plugin
->
StreamDecode
(
client
,
*
is
);
}
catch
(
StopDecoder
)
{
}
}
else
{
fprintf
(
stderr
,
"Decoder plugin is not usable
\n
"
);
return
EXIT_FAILURE
;
...
...
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