Move the void *user_data parameter at the end of the function. For consistency,
since most opaque pointers are passed at the end of functions in the VLC code
base.
Currently, the input_thread_t is controllable by either input_Control, specific
functions, by variables or by the 3 previous solutions.
The goal of this commit is to remove variables usage when it's not necessary.
This commit doesn't remove variables that should be used to pass users settings
(cf. input_ConfigVarInit).
The "intf-event" callback is replaced by the new callback
input_thread_events_cb that pass a new event: struct vlc_input_event. There can
be only one listener: the creator of the input_thread_t. In the future, the new
vlc input controller will receive these events and forward them to all
listeners.
In the meantime, I added input_LegacyVarInit, input_LegacyVarStop, and
input_LegacyEvents, 3 helpers functions that reproduce the legacy variable
behavior (transform new vlc_input_event to old intf-event events). These 3
functions are meant to be removed for 4.0 release (when vlc input controller is
added).
For now, the playlist, the media_player, VLM and modules still use the legacy
variables.
In case of thread cancellation (when the audio fingerprinter window is
closed during processing), the current fingerprint request might be left
both in the processing and results queues.
As a consequence, fingerprint_request_Delete() was called twice during
CleanSys(), leading to double-free.
To avoid the problem, remove a request from the processing queue
immediately after it has been added to the results queue, before
vlc_testcancel().
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
It does not make sense for the passed index to be negative, nor is the
current diagnostic related to comparision of different signedness very
nice to look at.
This fixes both issues by changing the argument to size_t, making sure
that the values passed are suitable for interaction with
vlc_array-related functions.
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
If the input state were initially "smaller or equal to" PAUSE_S, the
loop would just run forever and deadlock. So assume it is always larger
and remove the slack.