diff options
Diffstat (limited to 'src/libsink')
| -rw-r--r-- | src/libsink/common.h | 1 | ||||
| -rw-r--r-- | src/libsink/sink.c | 27 | ||||
| -rw-r--r-- | src/libsink/sink.h | 2 |
3 files changed, 18 insertions, 12 deletions
diff --git a/src/libsink/common.h b/src/libsink/common.h index dc0b207..0bb3ded 100644 --- a/src/libsink/common.h +++ b/src/libsink/common.h @@ -1,7 +1,6 @@ #pragma once #define CAMU_SINK_LOCAL -//#define CAMU_SINK_SCUFFED_LOOP enum { CAMU_SINK_SET = 0, diff --git a/src/libsink/sink.c b/src/libsink/sink.c index 12b8bca..f792001 100644 --- a/src/libsink/sink.c +++ b/src/libsink/sink.c @@ -331,6 +331,8 @@ static void handle_sink_cmd(struct camu_sink *sink, struct camu_sink_cmd *cmd) struct nn_packet *packet = nn_rpc_get_packet(&sink->client, CAMU_SERVER_LIST_ACTION); nn_packet_write_str(packet, &sink->default_list); nn_packet_write_u8(packet, CAMU_LIST_END); + struct camu_sink_entry *entry = (struct camu_sink_entry *)cmd->opaque; + nn_packet_write_u32(packet, entry->id); nn_packet_write_u32(packet, (u32)cmd->value.u); nn_rpc_connection_command(sink->conn, packet, NULL, NULL); break; @@ -629,22 +631,18 @@ static void pause_and_swap_to(struct camu_sink *sink, struct camu_sink_entry *ta static bool end_entry_and_advance_queue(struct camu_sink *sink, struct camu_sink_entry *entry) { -#ifdef CAMU_SINK_SCUFFED_LOOP - al_log_info("sink", "Looping."); - queue_cmd(sink, (struct camu_sink_cmd){ - .op = SEEK, - .value.f = 0.0, - .opaque = entry - }); - return true; -#endif al_log_info("sink", "Entry ended."); entry->ended = true; queue_cmd(sink, (struct camu_sink_cmd){ .op = END, - .value.u = entry->id + .value.u = entry->reset_id, + .opaque = entry }); maybe_remove_from_previous(sink, entry); +#ifdef LIANA_LIST_SCUFFED_LOOP + al_log_info("sink", "Looping."); + return true; +#endif if (sink->target) { switch_to(sink, sink->target); sink->target = NULL; @@ -1129,6 +1127,7 @@ static bool set_command_callback(void *userdata, struct nn_rpc_connection *conn, u64 seek_pos = nn_packet_read_u64(packet); u8 pause = nn_packet_read_u8(packet); bool ended = nn_packet_read_bool(packet); + u32 reset_id = nn_packet_read_u32(packet); bool created = false; struct camu_sink_entry *entry = get_entry_from_id(sink, id); @@ -1139,6 +1138,7 @@ static bool set_command_callback(void *userdata, struct nn_rpc_connection *conn, entry->sequence = sequence; sink->lru = al_u16_inc_wrap(sink->lru); entry->lru = sink->lru; + entry->reset_id = reset_id; if (created) { camu_clock_set(&entry->clock, seek_pos / 1000000.0); @@ -1311,9 +1311,14 @@ static bool seek_command_callback(void *userdata, struct nn_rpc_connection *conn (void)sequence; u64 at = nn_packet_read_u64(packet); u64 pos = nn_packet_read_u64(packet); + u32 reset_id = nn_packet_read_u32(packet); struct camu_sink_entry *entry = get_entry_from_id(sink, id); - if (!entry) goto out; + if (!entry) { + goto out; + } + + entry->reset_id = reset_id; #ifdef CAMU_SINK_LOCAL at = 0; diff --git a/src/libsink/sink.h b/src/libsink/sink.h index 4f719d2..c08f763 100644 --- a/src/libsink/sink.h +++ b/src/libsink/sink.h @@ -41,6 +41,7 @@ struct camu_sink_entry { s32 sequence; u16 lru; bool ended; + u32 reset_id; struct camu_clock clock; struct lia_client client; struct { @@ -98,6 +99,7 @@ struct camu_sink { struct camu_renderer *renderer; } video; #endif + struct lia_server *local_server; u8 (*callback)(void *, u8, u8, void *); void *userdata; }; |