This provides a common implementation of fast (non-debug),
error-checking (debug) and recursive muteces on top of
vlc_atomic_wait() and vlc_atomic_notify_one(), using Drepper's tristate
mutex algorithm.
Benefits of this implementation include:
- Error checking is supported on all platforms (including Windows).
- Initialization can never fail, is not subject to aborts.
- Destruction is a no-op and can be removed altogether.
- Static muteces do not leak or need kludges.
- Ownership can be checked directly without the mutex mark system.
- Non-ownership can be checked in assertion.
Because the player code uses the same vlc_mutex_t typedef for both
non-recursive and recursive usages, disentanglement is not possible.
This patchset thus supports both semantics together as before.
This gets rid of some platform-specific code. The more interesting
consequence is allowing custom mutex implementation later, which would
not otherwise be possible, due to vlc_cond_wait() entanglement.
With more than one thread waiting on the same condition variable, the
lock-step logic could (at least theoretically) lose a wake-up in 2**32.
This patch uses a linked-list instead, with one atomic variable per
waiting thread, so we know exactly which threads are woken up
(musl uses a similar strategy for non-shared condition variables.)
Notes:
- A singly linked list is inadequate here, as a thread may need to
remove itself from the list on time-out or spurious wake-ups from
atomic_wait().
- vlc_list cannot be used here as it cannot sustain the definition of
VLC_STATIC_COND. Furthermore, vlc_list undefines the list node on
removal, which is inappropriate as per the previous note.
This changes the function prototype and semantics to more closely match
the other VLC timed-wait functions:
- Return 0 on success, or an error code on "error", i.e., time-out.
- Take an absolute deadline rather than a relative delay in.
This fixes time drift due to preemption and simplifies the call sites.
This allows focus to be reset on the last item when navigating back rather
that having it on the navigation bar and having to go down to get it on the
item.
This doesn't force the focus when navigating with history buttons or when
changing tab.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
This dialog allows to ask simple Yes/No questions, such as action
confirmation, with a simple callback mechanism.
The modal dialog need to be attached to the root widget to be displayed
properly.
Using vlc_dialog_wait_question for this would block the UI.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
MlFoldersModel did require a vlc_medialibrary_t instance in its constructor
which can't be provided from QML.
* A setMl accessor is kept to keep it easily usable from Qt native.
* provide named roles
* remove delete role in favor of the exposed function (doesn't makes sens to
remove an entry by setting one of its properties)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
We need to monitor the original model directly as the DelegateModel won't
notify us when the data is updated.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
This prepare for next patch where the ExpandGridView needs both the model and
the delegate model
Fix name collision in calling sites.
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
the behavior is not shared amongst the view where it's used
(different behavior in the Genre view)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Depending on the call order of vlc_player_UpdateTimerSource and
vlc_player_UpdateTimer, the system_date of the best timer source would
sometimes not be updated to INT64_MAX on pause.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Switch are optimized at least to the same form anyway, and they provide
better warnings in case of missing items as well as preventing typos.
It also fixes a cast warning as OMX_STATETYPE was used instead of the
enum ERRORTYPE in the error to string function, and adds missing items
from the enums.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Encoded output is stored in VLCs settings by adding the
AOUT_VAR_SPDIF_FLAG flag to the integer. Make sure this
configuration is also picked up again after restart, if it is stored
and actually available.
Credits: Andrey Y.
fixes#21170