From e651ac80f1e59947156ffd91d4aed960c8fd117e Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Mon, 28 Aug 2023 10:14:33 +0200 Subject: [PATCH] player: signal on_current_media_stopping event Signal that the media is stopping to the client. This is done after input_Stop so that application can rely on the fact that the underlying input_thread is already stopping, so that we can trigger actions like EOS, closing input resources, etc. --- src/player/player.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/player/player.c b/src/player/player.c index 8add44d845..2f0ddb6d1b 100644 --- a/src/player/player.c +++ b/src/player/player.c @@ -223,7 +223,12 @@ vlc_player_destructor_Thread(void *data) VLC_TICK_INVALID); vlc_player_destructor_AddStoppingInput(player, input); + /* Note: no need to hold the media here, it will be valid + * until input_Close() and the event is sent from the thread + * that will call this function. */ + input_item_t *media = input_GetItem(input->thread); input_Stop(input->thread); + vlc_player_SendEvent(player, on_stopping_current_media, media); } bool keep_sout = true;