From fac610d47b46e93fd5743d0a6b891eacab8c7e45 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 17 Nov 2016 22:48:18 +0100 Subject: [PATCH] decoder/API: decoder_open_uri() can throw StopDecoder --- src/decoder/DecoderAPI.cxx | 2 +- src/decoder/DecoderAPI.hxx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/decoder/DecoderAPI.cxx b/src/decoder/DecoderAPI.cxx index 6bdaddb02..d673311e9 100644 --- a/src/decoder/DecoderAPI.cxx +++ b/src/decoder/DecoderAPI.cxx @@ -275,7 +275,7 @@ decoder_open_uri(Decoder &decoder, const char *uri) return is; if (dc.command == DecoderCommand::STOP) - return nullptr; + throw StopDecoder(); cond.wait(mutex); } diff --git a/src/decoder/DecoderAPI.hxx b/src/decoder/DecoderAPI.hxx index d400dbda2..16b63d8e5 100644 --- a/src/decoder/DecoderAPI.hxx +++ b/src/decoder/DecoderAPI.hxx @@ -118,8 +118,9 @@ void decoder_seek_error(Decoder &decoder); /** - * Open a new #InputStream and wait until it's ready. Can get - * cancelled by DecoderCommand::STOP (returns nullptr). + * Open a new #InputStream and wait until it's ready. + * + * Throws #StopDecoder if DecoderCommand::STOP was received. * * Throws std::runtime_error on error. */