Commit a50b2c3b authored by Max Kellermann's avatar Max Kellermann

output/Thread: rename {Play,Pause}() to Internal{Play,Pause}()

parent ebecee3d
...@@ -370,12 +370,17 @@ private: ...@@ -370,12 +370,17 @@ private:
* been reached (and no more chunks are queued), or until a * been reached (and no more chunks are queued), or until a
* command is received. * command is received.
* *
* Runs inside the OutputThread. Handles exceptions.
*
* @return true if at least one chunk has been available, * @return true if at least one chunk has been available,
* false if the tail of the pipe was already reached * false if the tail of the pipe was already reached
*/ */
bool Play() noexcept; bool InternalPlay() noexcept;
void Pause() noexcept; /**
* Runs inside the OutputThread. Handles exceptions.
*/
void InternalPause() noexcept;
/** /**
* The OutputThread. * The OutputThread.
......
...@@ -340,7 +340,7 @@ AudioOutputControl::PlayChunk() noexcept ...@@ -340,7 +340,7 @@ AudioOutputControl::PlayChunk() noexcept
} }
inline bool inline bool
AudioOutputControl::Play() noexcept AudioOutputControl::InternalPlay() noexcept
{ {
if (!FillSourceOrClose()) if (!FillSourceOrClose())
/* no chunk available */ /* no chunk available */
...@@ -411,7 +411,7 @@ AudioOutput::IteratePause() noexcept ...@@ -411,7 +411,7 @@ AudioOutput::IteratePause() noexcept
} }
inline void inline void
AudioOutputControl::Pause() noexcept AudioOutputControl::InternalPause() noexcept
{ {
output->BeginPause(); output->BeginPause();
CommandFinished(); CommandFinished();
...@@ -488,7 +488,7 @@ AudioOutputControl::Task() ...@@ -488,7 +488,7 @@ AudioOutputControl::Task()
break; break;
} }
Pause(); InternalPause();
/* don't "break" here: this might cause /* don't "break" here: this might cause
Play() to be called when command==CLOSE Play() to be called when command==CLOSE
ends the paused state - "continue" checks ends the paused state - "continue" checks
...@@ -522,7 +522,7 @@ AudioOutputControl::Task() ...@@ -522,7 +522,7 @@ AudioOutputControl::Task()
return; return;
} }
if (output->open && allow_play && Play()) if (output->open && allow_play && InternalPlay())
/* don't wait for an event if there are more /* don't wait for an event if there are more
chunks in the pipe */ chunks in the pipe */
continue; continue;
......
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