diff options
author | Max Kellermann <max@musicpd.org> | 2019-08-03 08:51:15 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-08-03 11:32:06 +0200 |
commit | 187204f03c319d68e7d883d644f96c353ff801e7 (patch) | |
tree | 5db2ba645f44b5b5b88c2d3e65083df804462718 /src | |
parent | 5e5fadb5f2ec0d9c5c5baba9fe3ec673a7c78617 (diff) |
decoder/mad: move code to HandleCurrentFrame()
Diffstat (limited to 'src')
-rw-r--r-- | src/decoder/plugins/MadDecoderPlugin.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index aa8772859..7cc57b245 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -202,6 +202,11 @@ private: */ DecoderCommand SyncAndSend() noexcept; + /** + * @return false to stop decoding + */ + bool HandleCurrentFrame() noexcept; + bool Read() noexcept; }; @@ -919,7 +924,7 @@ MadDecoder::SyncAndSend() noexcept } inline bool -MadDecoder::Read() noexcept +MadDecoder::HandleCurrentFrame() noexcept { switch (mute_frame) { DecoderCommand cmd; @@ -956,6 +961,15 @@ MadDecoder::Read() noexcept return false; } + return true; +} + +inline bool +MadDecoder::Read() noexcept +{ + if (!HandleCurrentFrame()) + return false; + while (true) { MadDecoderAction ret; do { |