summaryrefslogtreecommitdiff
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-11-11 08:30:11 +0100
committerMax Kellermann <max@duempel.org>2014-11-11 08:30:11 +0100
commit466b6a23cdce42143a25f87ce2234e045e963bdf (patch)
tree708ecdea0b916c84b4d71b3738a415f87511d729 /src/decoder
parent4a04f73434ed6953ae1403d6f1eb33a3807e01d7 (diff)
decoder/opus: eliminate flag "found_opus"
Check opus_decoder!=nullptr instead.
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/plugins/OpusDecoderPlugin.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/decoder/plugins/OpusDecoderPlugin.cxx b/src/decoder/plugins/OpusDecoderPlugin.cxx
index 9599f7bcf..cf102a9b5 100644
--- a/src/decoder/plugins/OpusDecoderPlugin.cxx
+++ b/src/decoder/plugins/OpusDecoderPlugin.cxx
@@ -78,7 +78,6 @@ class MPDOpusDecoder {
opus_int16 *output_buffer;
bool os_initialized;
- bool found_opus;
int opus_serialno;
@@ -92,7 +91,7 @@ public:
:decoder(_decoder), input_stream(_input_stream),
opus_decoder(nullptr),
output_buffer(nullptr),
- os_initialized(false), found_opus(false) {}
+ os_initialized(false) {}
~MPDOpusDecoder();
bool ReadFirstPage(OggSyncState &oy);
@@ -168,7 +167,7 @@ MPDOpusDecoder::HandlePacket(const ogg_packet &packet)
if (packet.b_o_s)
return HandleBOS(packet);
- else if (!found_opus)
+ else if (opus_decoder == nullptr)
return DecoderCommand::STOP;
if (IsOpusTags(packet))
@@ -230,7 +229,7 @@ MPDOpusDecoder::HandleBOS(const ogg_packet &packet)
{
assert(packet.b_o_s);
- if (found_opus || !IsOpusHead(packet))
+ if (opus_decoder != nullptr || !IsOpusHead(packet))
return DecoderCommand::STOP;
unsigned channels;
@@ -242,7 +241,6 @@ MPDOpusDecoder::HandleBOS(const ogg_packet &packet)
assert(output_buffer == nullptr);
opus_serialno = os.serialno;
- found_opus = true;
/* TODO: parse attributes from the OpusHead (sample rate,
channels, ...) */