summaryrefslogtreecommitdiff
path: root/src/decoder/Thread.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-04-05 08:38:40 +0200
committerMax Kellermann <max@musicpd.org>2019-04-05 09:26:03 +0200
commita19eee78c69a04efdd210b3baf2a44115f4de81c (patch)
tree89f0a09ff44acc5ac8487707bc5c35e49839dc0b /src/decoder/Thread.cxx
parent6be3c99876870176ce71b745c96c589272cc17e5 (diff)
decoder/Bridge: make many attributes private
Diffstat (limited to 'src/decoder/Thread.cxx')
-rw-r--r--src/decoder/Thread.cxx17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/decoder/Thread.cxx b/src/decoder/Thread.cxx
index 9021af57a..f34d0f429 100644
--- a/src/decoder/Thread.cxx
+++ b/src/decoder/Thread.cxx
@@ -210,7 +210,7 @@ decoder_run_stream_plugin(DecoderBridge &bridge, InputStream &is,
if (!decoder_check_plugin(plugin, is, suffix))
return false;
- bridge.error = std::exception_ptr();
+ bridge.Reset();
tried_r = true;
return decoder_stream_decode(plugin, bridge, is);
@@ -316,7 +316,7 @@ TryDecoderFile(DecoderBridge &bridge, Path path_fs, const char *suffix,
if (!plugin.SupportsSuffix(suffix))
return false;
- bridge.error = std::exception_ptr();
+ bridge.Reset();
DecoderControl &dc = bridge.dc;
@@ -344,7 +344,7 @@ TryContainerDecoder(DecoderBridge &bridge, Path path_fs, const char *suffix,
!plugin.SupportsSuffix(suffix))
return false;
- bridge.error = nullptr;
+ bridge.Reset();
DecoderControl &dc = bridge.dc;
const std::lock_guard<Mutex> protect(dc.mutex);
@@ -472,19 +472,16 @@ decoder_run_song(DecoderControl &dc,
AtScopeExit(&bridge) {
/* flush the last chunk */
- if (bridge.current_chunk != nullptr)
- bridge.FlushChunk();
+ bridge.CheckFlushChunk();
};
success = DecoderUnlockedRunUri(bridge, uri, path_fs);
}
- if (bridge.error) {
- /* copy the Error from struct Decoder to
- DecoderControl */
- std::rethrow_exception(bridge.error);
- } else if (success)
+ bridge.CheckRethrowError();
+
+ if (success)
dc.state = DecoderState::STOP;
else {
const char *error_uri = song.GetURI();