summaryrefslogtreecommitdiff
path: root/src/libsink
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-10-30 16:06:00 -0400
committerAndrew Opalach <andrew@akon.city> 2025-10-30 16:06:00 -0400
commit221c80c5068c35ef30b0583cba2dad1b6c4560bf (patch)
tree76d3a07448b08cb465dbd63a7c15f8318b48e71f /src/libsink
parentf7e23d3c5e47ec0c105bf506e58e23f635faa20e (diff)
downloadcamu-221c80c5068c35ef30b0583cba2dad1b6c4560bf.tar.gz
camu-221c80c5068c35ef30b0583cba2dad1b6c4560bf.tar.bz2
camu-221c80c5068c35ef30b0583cba2dad1b6c4560bf.zip
Rename sink->detached to sink->suspended
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/libsink')
-rw-r--r--src/libsink/sink.c34
-rw-r--r--src/libsink/sink.h4
2 files changed, 19 insertions, 19 deletions
diff --git a/src/libsink/sink.c b/src/libsink/sink.c
index aa9542e..7b173a9 100644
--- a/src/libsink/sink.c
+++ b/src/libsink/sink.c
@@ -695,17 +695,17 @@ static void switch_to(struct camu_sink *sink, struct camu_sink_entry *target)
bool ensure_removed = false;
if (current) {
- struct camu_sink_entry *detached = sink->detached;
+ struct camu_sink_entry *suspended = sink->suspended;
al_assert(current != target);
- ensure_removed = detached || current->ended;
- if (detached) {
- al_assert(detached == current);
+ ensure_removed = suspended || current->ended;
+ if (suspended) {
+ al_assert(suspended == current);
// A buffer's state being QUEUED should be impossible while it's
- // entry is reconnecting.
- al_assert(AUDIO_STATE(detached) != BUFFER_QUEUED);
- al_assert(VIDEO_STATE(detached) != BUFFER_QUEUED);
- sink->detached = NULL;
- log_warn("Unset detached as a substitute for remove.");
+ // entry is suspended.
+ al_assert(AUDIO_STATE(suspended) != BUFFER_QUEUED);
+ al_assert(VIDEO_STATE(suspended) != BUFFER_QUEUED);
+ sink->suspended = NULL;
+ log_warn("Unset suspended entry as a substitute for remove.");
} else if (!current->ended) {
maybe_add_to_previous(sink, current, target);
}
@@ -1119,7 +1119,7 @@ static void client_callback(void *userdata, u8 op, struct camu_codec_stream *str
// If this entry is still current on CLIENT_RECONNECTED, re-add it's buffers.
if (entry == sink->current && rec->reconnect) {
- sink->detached = entry;
+ sink->suspended = entry;
}
// This entry might be in previous if it was added to previous then,
@@ -1241,8 +1241,8 @@ static void client_callback(void *userdata, u8 op, struct camu_codec_stream *str
case LIANA_CLIENT_RECONNECTED: {
struct lia_reconnect_info *rec = (struct lia_reconnect_info *)opaque;
nn_mutex_lock(&sink->lock);
- log_trace("reconnected("ENTRY_FMT"), detached: "ENTRY_FMT", audio_state: %hhu, video_state: %hhu.", ENTRY_ARG(entry), ENTRY_ARG(sink->detached), AUDIO_STATE(entry), VIDEO_STATE(entry));
- if (entry == sink->detached) {
+ log_trace("reconnected("ENTRY_FMT"), suspended: "ENTRY_FMT", audio_state: %hhu, video_state: %hhu.", ENTRY_ARG(entry), ENTRY_ARG(sink->suspended), AUDIO_STATE(entry), VIDEO_STATE(entry));
+ if (entry == sink->suspended) {
al_assert(entry == sink->current);
// Let this be the only other explicit BUFFER_ENDED check, or this will
// become too complicated.
@@ -1263,7 +1263,7 @@ static void client_callback(void *userdata, u8 op, struct camu_codec_stream *str
} else if (!VIDEO_EMPTY(entry) && !VIDEO_IS_SINGLE_FRAME(entry)) {
add_video_if_set_and_buffered(entry);
}
- sink->detached = NULL;
+ sink->suspended = NULL;
}
nn_mutex_unlock(&sink->lock);
break;
@@ -1308,9 +1308,9 @@ static void client_callback(void *userdata, u8 op, struct camu_codec_stream *str
sink->target = (struct camu_sink_entry *)0xb00b;
log_warn("Attempting to handle a disconnected target.");
} else if (entry == sink->current) {
- if (sink->detached) {
- al_assert(sink->detached == sink->current);
- sink->detached = NULL;
+ if (sink->suspended) {
+ al_assert(sink->suspended == sink->current);
+ sink->suspended = NULL;
}
if (sink->target) {
switch_to(sink, sink->target);
@@ -1707,7 +1707,7 @@ bool camu_sink_init(struct camu_sink *sink, struct nn_event_loop *loop,
sink->current = NULL;
sink->queued = NULL;
sink->target = NULL;
- sink->detached = NULL;
+ sink->suspended = NULL;
al_array_init(sink->previous);
al_array_init(sink->entries);
// Start high to exercise the wrapping path.
diff --git a/src/libsink/sink.h b/src/libsink/sink.h
index f2ae20f..2c96313 100644
--- a/src/libsink/sink.h
+++ b/src/libsink/sink.h
@@ -91,8 +91,8 @@ struct camu_sink {
struct camu_sink_entry *current;
struct camu_sink_entry *queued;
struct camu_sink_entry *target;
- // @TODO: Rename detached to reconnecing.
- struct camu_sink_entry *detached;
+ // If an entry that was current was removed for a reconnect, it's "suspended".
+ struct camu_sink_entry *suspended;
array(struct camu_sink_entry *) previous;
array(struct camu_sink_entry *) entries;
u16 lru;