diff options
Diffstat (limited to 'src/liana')
| -rw-r--r-- | src/liana/list.c | 20 | ||||
| -rw-r--r-- | src/liana/list.h | 10 |
2 files changed, 16 insertions, 14 deletions
diff --git a/src/liana/list.c b/src/liana/list.c index d5eef48..7d3d722 100644 --- a/src/liana/list.c +++ b/src/liana/list.c @@ -27,6 +27,7 @@ enum { static inline u32 get_incremental_id(struct lia_list *list) { list->increment = al_u32_inc_wrap(list->increment); + al_assert(list->increment > 0); // Wrapping not currently handled. return list->increment; } @@ -254,7 +255,7 @@ static bool handle_skipto(struct lia_list *list, s32 sequence, s32 index) if (sequence == LIANA_SEQUENCE_ANY) sequence = list->current; if (sequence < 0) return true; // list->current = -1 if (sequence != list->current) { - warn("Discarding out of date skip()."); + log_warn("Discarding out of date skip()."); return true; } @@ -319,7 +320,7 @@ static bool handle_skipto(struct lia_list *list, s32 sequence, s32 index) current->held = true; } - trace("skipto(#%u-#%u): pause: %hhu, held: %s.", current->id, target->id, pause, BOOLSTR(current->held)); + log_trace("skipto(#%u-#%u): pause: %hhu, held: %s.", current->id, target->id, pause, BOOLSTR(current->held)); struct lia_timing time = { .at = at, @@ -345,7 +346,7 @@ static void handle_toggle_pause(struct lia_list *list, s32 sequence, f64 pts) if (sequence == LIANA_SEQUENCE_ANY) sequence = list->current; if (sequence < 0) return; // list->current = -1 if (sequence != list->current) { - warn("Discarding out of date toggle_pause()."); + log_warn("Discarding out of date toggle_pause()."); return; } @@ -376,7 +377,7 @@ static void handle_toggle_pause(struct lia_list *list, s32 sequence, f64 pts) break; } - trace("toggle_pause(#%u): pts: %f, pause: %hhu.", entry->id, pts, pause); + log_trace("toggle_pause(#%u): pts: %f, pause: %hhu.", entry->id, pts, pause); struct lia_timing time = { .at = at, @@ -404,7 +405,7 @@ static void handle_seek(struct lia_list *list, s32 sequence, u32 id, u64 pos) al_assert(entry); if (entry->duration == 0 || entry->duration == LIANA_TIMESTAMP_INVALID) { - warn("Skipping seek on entry with no duration."); + log_warn("Skipping seek on entry with no duration."); return; } @@ -422,7 +423,7 @@ static void handle_seek(struct lia_list *list, s32 sequence, u32 id, u64 pos) list->idle = false; - trace("seek(#%u): pos: %f, pause: %hhu.", entry->id, pos / 1000000.0, pause); + log_trace("seek(#%u): pos: %f, pause: %hhu.", entry->id, pos / 1000000.0, pause); struct lia_timing time = { .at = at, @@ -449,16 +450,16 @@ static bool handle_end(struct lia_list *list, u32 id, u32 reset_id) struct lia_list_entry *entry = get_entry_from_sequence(list, sequence); if (reset_id != entry->reset_id) { - warn("Got end() with out of order or incorrect reset id, ignoring."); + log_warn("Got end() with out of order or incorrect reset id, ignoring."); return true; } if (entry->ended) { - warn("Got end() from an already ended resource, ignoring."); + log_warn("Got end() from an already ended resource, ignoring."); return true; } - trace("end(#%u).", entry->id); + log_trace("end(#%u).", entry->id); entry->ended = true; entry->offset = entry->duration; @@ -518,6 +519,7 @@ static bool adjust_current(struct lia_list *list, struct lia_list_entry *previou } } al_assert(entry && cmd->op == SKIPTO); + signal_meta(list, previous, LIANA_META_ORDER_CHANGED); return handle_skipto(list, cmd->sequence, cmd->arg0.i); } diff --git a/src/liana/list.h b/src/liana/list.h index 70873ff..86a9712 100644 --- a/src/liana/list.h +++ b/src/liana/list.h @@ -7,7 +7,7 @@ #define LIANA_SEQUENCE_ANY -1 #define LIANA_TIMESTAMP_INVALID ((u64)-1) -#define LIANA_BASE_DELAY 500000u // 500ms +#define LIANA_BASE_DELAY 600000u // 600ms #define LIANA_BASE_PING 125000u // 125ms #define LIANA_PAUSE_DELAY LIANA_BASE_PING #define LIANA_DELAY_IGNORE 0u @@ -49,13 +49,13 @@ enum { }; enum { - LIANA_META_CURRENT_CHANGED = 0, - LIANA_META_ADDED_ENTRY, + LIANA_META_ADDED_ENTRY = 0, LIANA_META_REMOVED_ENTRY, + LIANA_META_CURRENT_CHANGED, + LIANA_META_ORDER_CHANGED, LIANA_META_ENTRY_PAUSED, LIANA_META_ENTRY_SEEKED, - LIANA_META_ENTRY_ERRORED, - LIANA_META_ORDER_CHANGED + LIANA_META_ENTRY_ERRORED }; enum { |