summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-29 09:23:57 +0100
committerMax Kellermann <max@duempel.org>2014-01-29 09:23:57 +0100
commitaf716057699c22cc3b553ee0e5bbd403b1478607 (patch)
tree7ef4e7f532ad8415a7e59dccbc211fcb9eb172cc
parent4657a3bd0fd97583e23cd65b80db71a71345fc13 (diff)
output: rename "chunk" to "current_chunk"
-rw-r--r--src/output/Internal.hxx11
-rw-r--r--src/output/MultipleOutputs.cxx15
-rw-r--r--src/output/OutputControl.cxx4
-rw-r--r--src/output/OutputThread.cxx28
4 files changed, 30 insertions, 28 deletions
diff --git a/src/output/Internal.hxx b/src/output/Internal.hxx
index 443d8c6cc..fe7452f17 100644
--- a/src/output/Internal.hxx
+++ b/src/output/Internal.hxx
@@ -32,6 +32,7 @@
class Error;
class Filter;
class MusicPipe;
+struct music_chunk;
struct config_param;
struct PlayerControl;
struct AudioOutputPlugin;
@@ -235,8 +236,8 @@ struct AudioOutput {
const MusicPipe *pipe;
/**
- * This mutex protects #open, #fail_timer, #chunk and
- * #chunk_finished.
+ * This mutex protects #open, #fail_timer, #current_chunk and
+ * #current_chunk_finished.
*/
Mutex mutex;
@@ -258,12 +259,12 @@ struct AudioOutput {
* #music_buffer, because they are not going to be used by
* this output anymore.
*/
- const struct music_chunk *chunk;
+ const music_chunk *current_chunk;
/**
- * Has the output finished playing #chunk?
+ * Has the output finished playing #current_chunk?
*/
- bool chunk_finished;
+ bool current_chunk_finished;
AudioOutput(const AudioOutputPlugin &_plugin);
~AudioOutput();
diff --git a/src/output/MultipleOutputs.cxx b/src/output/MultipleOutputs.cxx
index 5d09b1733..66390f24d 100644
--- a/src/output/MultipleOutputs.cxx
+++ b/src/output/MultipleOutputs.cxx
@@ -264,17 +264,18 @@ chunk_is_consumed_in(const AudioOutput *ao,
if (!ao->open)
return true;
- if (ao->chunk == nullptr)
+ if (ao->current_chunk == nullptr)
return false;
- assert(chunk == ao->chunk || pipe->Contains(ao->chunk));
+ assert(chunk == ao->current_chunk ||
+ pipe->Contains(ao->current_chunk));
- if (chunk != ao->chunk) {
+ if (chunk != ao->current_chunk) {
assert(chunk->next != nullptr);
return true;
}
- return ao->chunk_finished && chunk->next == nullptr;
+ return ao->current_chunk_finished && chunk->next == nullptr;
}
bool
@@ -309,9 +310,9 @@ MultipleOutputs::ClearTailChunk(gcc_unused const struct music_chunk *chunk,
continue;
}
- assert(ao->chunk == chunk);
- assert(ao->chunk_finished);
- ao->chunk = nullptr;
+ assert(ao->current_chunk == chunk);
+ assert(ao->current_chunk_finished);
+ ao->current_chunk = nullptr;
}
}
diff --git a/src/output/OutputControl.cxx b/src/output/OutputControl.cxx
index 921369722..89428fa87 100644
--- a/src/output/OutputControl.cxx
+++ b/src/output/OutputControl.cxx
@@ -124,7 +124,7 @@ AudioOutput::Open(const AudioFormat audio_format, const MusicPipe &mp)
assert(pipe == &mp || (always_on && pause));
if (pause) {
- chunk = nullptr;
+ current_chunk = nullptr;
pipe = &mp;
/* unpause with the CANCEL command; this is a
@@ -141,7 +141,7 @@ AudioOutput::Open(const AudioFormat audio_format, const MusicPipe &mp)
}
in_audio_format = audio_format;
- chunk = nullptr;
+ current_chunk = nullptr;
pipe = &mp;
diff --git a/src/output/OutputThread.cxx b/src/output/OutputThread.cxx
index fcbd22c6a..841520582 100644
--- a/src/output/OutputThread.cxx
+++ b/src/output/OutputThread.cxx
@@ -139,7 +139,7 @@ ao_open(AudioOutput *ao)
assert(!ao->open);
assert(ao->pipe != nullptr);
- assert(ao->chunk == nullptr);
+ assert(ao->current_chunk == nullptr);
assert(ao->in_audio_format.IsValid());
ao->fail_timer.Reset();
@@ -212,7 +212,7 @@ ao_close(AudioOutput *ao, bool drain)
ao->pipe = nullptr;
- ao->chunk = nullptr;
+ ao->current_chunk = nullptr;
ao->open = false;
ao->mutex.unlock();
@@ -252,7 +252,7 @@ ao_reopen_filter(AudioOutput *ao)
ao->pipe = nullptr;
- ao->chunk = nullptr;
+ ao->current_chunk = nullptr;
ao->open = false;
ao->fail_timer.Update();
@@ -486,9 +486,9 @@ ao_play_chunk(AudioOutput *ao, const struct music_chunk *chunk)
static const struct music_chunk *
ao_next_chunk(AudioOutput *ao)
{
- return ao->chunk != nullptr
+ return ao->current_chunk != nullptr
/* continue the previous play() call */
- ? ao->chunk->next
+ ? ao->current_chunk->next
/* get the first chunk from the pipe */
: ao->pipe->Peek();
}
@@ -514,30 +514,30 @@ ao_play(AudioOutput *ao)
/* no chunk available */
return false;
- ao->chunk_finished = false;
+ ao->current_chunk_finished = false;
assert(!ao->in_playback_loop);
ao->in_playback_loop = true;
while (chunk != nullptr && ao->command == AO_COMMAND_NONE) {
- assert(!ao->chunk_finished);
+ assert(!ao->current_chunk_finished);
- ao->chunk = chunk;
+ ao->current_chunk = chunk;
success = ao_play_chunk(ao, chunk);
if (!success) {
- assert(ao->chunk == nullptr);
+ assert(ao->current_chunk == nullptr);
break;
}
- assert(ao->chunk == chunk);
+ assert(ao->current_chunk == chunk);
chunk = chunk->next;
}
assert(ao->in_playback_loop);
ao->in_playback_loop = false;
- ao->chunk_finished = true;
+ ao->current_chunk_finished = true;
ao->mutex.unlock();
ao->player_control->LockSignal();
@@ -637,7 +637,7 @@ audio_output_task(void *arg)
case AO_COMMAND_DRAIN:
if (ao->open) {
- assert(ao->chunk == nullptr);
+ assert(ao->current_chunk == nullptr);
assert(ao->pipe->Peek() == nullptr);
ao->mutex.unlock();
@@ -649,7 +649,7 @@ audio_output_task(void *arg)
continue;
case AO_COMMAND_CANCEL:
- ao->chunk = nullptr;
+ ao->current_chunk = nullptr;
if (ao->open) {
ao->mutex.unlock();
@@ -661,7 +661,7 @@ audio_output_task(void *arg)
continue;
case AO_COMMAND_KILL:
- ao->chunk = nullptr;
+ ao->current_chunk = nullptr;
ao_command_finished(ao);
ao->mutex.unlock();
return;