Commit 187204f0 authored by Max Kellermann's avatar Max Kellermann

decoder/mad: move code to HandleCurrentFrame()

parent 5e5fadb5
...@@ -202,6 +202,11 @@ private: ...@@ -202,6 +202,11 @@ private:
*/ */
DecoderCommand SyncAndSend() noexcept; DecoderCommand SyncAndSend() noexcept;
/**
* @return false to stop decoding
*/
bool HandleCurrentFrame() noexcept;
bool Read() noexcept; bool Read() noexcept;
}; };
...@@ -919,7 +924,7 @@ MadDecoder::SyncAndSend() noexcept ...@@ -919,7 +924,7 @@ MadDecoder::SyncAndSend() noexcept
} }
inline bool inline bool
MadDecoder::Read() noexcept MadDecoder::HandleCurrentFrame() noexcept
{ {
switch (mute_frame) { switch (mute_frame) {
DecoderCommand cmd; DecoderCommand cmd;
...@@ -956,6 +961,15 @@ MadDecoder::Read() noexcept ...@@ -956,6 +961,15 @@ MadDecoder::Read() noexcept
return false; return false;
} }
return true;
}
inline bool
MadDecoder::Read() noexcept
{
if (!HandleCurrentFrame())
return false;
while (true) { while (true) {
MadDecoderAction ret; MadDecoderAction ret;
do { do {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment