[vlc-devel] [PATCH 3.x 0/2] RFC: libvlc_media_player: add async stop

Thomas Guillem thomas at gllm.fr
Mon Oct 19 16:07:35 CEST 2020


I don't think the current libvlc_media_player_stop() is usable since it
is blocking. VLC ports usually call it from background threads, but it
lead to deadlocks when the mainthread is calling libvlc_media_player getter

This set of patch adds support for asynchronous stop() in VLC 3.x. It
will be needed for the iOS VLC port. It can be applied in vlc-ios patch
set directly but I do think this set could be helpful for LibVLC 3.x

I don't know if it's OK to add 2 APIs for a hotfix release. Maybe call
it VLC 3.1 ?

PS: vlc-android has the same problem but it was fixed on the application
(calling stop from app background thread, and creating a new
media_player for each new medias).

Thomas Guillem (2):
  lib: media_player: add stop/set_media async support
  WIP: lib: media_list_player: change media asynchronously

 include/vlc/libvlc_media_player.h |  28 ++++-
 lib/libvlc.sym                    |   2 +
 lib/media_list_player.c           |   4 +-
 lib/media_player.c                | 182 +++++++++++++++++++++++++-----
 lib/media_player_internal.h       |  16 ++-
 test/libvlc/media_player.c        |  48 ++++++++
 6 files changed, 249 insertions(+), 31 deletions(-)


More information about the vlc-devel mailing list