Commit ccea6dd7 authored by Max Kellermann's avatar Max Kellermann

player/Thread: rename WaitForDecoder() to ActivateDecoder()

.. and fix its API documentation.
parent 166b490e
...@@ -195,7 +195,7 @@ private: ...@@ -195,7 +195,7 @@ private:
/** /**
* The decoder has acknowledged the "START" command (see * The decoder has acknowledged the "START" command (see
* player::WaitForDecoder()). This function checks if the decoder * ActivateDecoder()). This function checks if the decoder
* initialization has completed yet. * initialization has completed yet.
* *
* The player lock is not held. * The player lock is not held.
...@@ -248,14 +248,19 @@ private: ...@@ -248,14 +248,19 @@ private:
bool ForwardDecoderError(); bool ForwardDecoderError();
/** /**
* After the decoder has been started asynchronously, wait for * After the decoder has been started asynchronously, activate
* the "START" command to finish. The decoder may not be * it for playback. That is, make the currently decoded song
* initialized yet, i.e. there is no audio_format information * active (assign it to #song), clear PlayerControl::next_song
* yet. * and #queued, initialize #elapsed_time, and set
* #decoder_starting.
*
* When returning, the decoder may not have completed startup
* yet, therefore we don't know the audio format yet. To
* finish decoder startup, call CheckDecoderStartup().
* *
* The player lock is not held. * The player lock is not held.
*/ */
bool WaitForDecoder(); bool ActivateDecoder();
/** /**
* Wrapper for MultipleOutputs::Open(). Upon failure, it * Wrapper for MultipleOutputs::Open(). Upon failure, it
...@@ -365,7 +370,7 @@ Player::ForwardDecoderError() ...@@ -365,7 +370,7 @@ Player::ForwardDecoderError()
} }
bool bool
Player::WaitForDecoder() Player::ActivateDecoder()
{ {
assert(queued || pc.command == PlayerCommand::SEEK); assert(queued || pc.command == PlayerCommand::SEEK);
assert(pc.next_song != nullptr); assert(pc.next_song != nullptr);
...@@ -574,7 +579,7 @@ Player::SeekDecoder() ...@@ -574,7 +579,7 @@ Player::SeekDecoder()
/* re-start the decoder */ /* re-start the decoder */
StartDecoder(*pipe); StartDecoder(*pipe);
if (!WaitForDecoder()) { if (!ActivateDecoder()) {
/* decoder failure */ /* decoder failure */
player_command_finished(pc); player_command_finished(pc);
return false; return false;
...@@ -937,7 +942,7 @@ Player::SongBorder() ...@@ -937,7 +942,7 @@ Player::SongBorder()
pc.outputs.SongBorder(); pc.outputs.SongBorder();
if (!WaitForDecoder()) if (!ActivateDecoder())
return false; return false;
pc.Lock(); pc.Lock();
...@@ -962,7 +967,7 @@ Player::Run() ...@@ -962,7 +967,7 @@ Player::Run()
pipe = new MusicPipe(); pipe = new MusicPipe();
StartDecoder(*pipe); StartDecoder(*pipe);
if (!WaitForDecoder()) { if (!ActivateDecoder()) {
assert(song == nullptr); assert(song == nullptr);
StopDecoder(); StopDecoder();
......
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