Wait 100ms before sending new events and drop identical events.
This fixes global Desktop freeze (happening on Gnome Shell with Debian stable)
when playing some files that update metadatas too much. This can also happen
when the playlist fail to open a lot of files in a row.
The do-not-queue flag is necessary to ensure that the bus name is
obtained immediately or not at all. Without it, each VLC instances gets
put into the queue for the same name.
Also, failure must be checked from the return value of the function,
not (typically) the low-level error flag.
Only the core should have permission to do forceful deletion of
entities.
This patch removes a mostly static, from outside of the core, argument
to playlist_NodeDelete, while also making it safer to use as it was
previously possible for anything with access to the function to delete
read-only entities.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
There is no need to query all keys when we are only interested in the
presence of a single one; these changes simplify the implementation to
properly reflect the intent.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
There is no need to query all keys when we are only interested in the
presence of a single one; these changes simplify the implementation to
properly reflect the intent.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
The return-value of vlc_dictionary_all_keys is a null-terminated array
of the associated keys (on success), meaning that there is no explicit
need to query the count of keys.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
This removes the insertion offset parameter to playlist_Add(),
playlist_AddExt() and playlist_AddInput().
intf_InsertItem() was the only occurrence where the offset was zero,
a side effect of how the command line is parsed backward. This is now
done explicitly with playlist_NodeAddInput().
A non-zero positive offset made no sense, since:
- the number of children of a node can change asynchronously while the
playlist lock,
- the back-end asserted or triggered undefined behaviour if the offset
was out of range.
DBus was the only occurrence of this bug (see also #17451 comment:4),
and has been fixed in an earlier change.
In all remaining call sites, the offset was PLAYLIST_END. This removes
the parameter which would otherwise constitute a useless constant.
They are set but never used. In practice, the (following) position
parameter determines whether the item is inserted or appended. A
positive position means insertion; PLAYLIST_END means appendment.
This might suppress some warnings (and very slightly reduce code size)
when assertions are disabled. Not that I particularly like to create
VLC-specific macros.