[vlc-devel] [PATCH v2 7/9] player: indicate if stop() is stopping

Rémi Denis-Courmont remi at remlab.net
Wed May 15 12:29:24 CEST 2019


Hi,

Entropy-wise, it makes sense. But not stopped yet sounds more like a case for returning EAGAIN (vs 0) than true, IMO.

Le 15 mai 2019 12:53:15 GMT+03:00, Romain Vimont <rom1v at videolabs.io> a écrit :
>From: Thomas Guillem <thomas at gllm.fr>
>
>---
> include/vlc_player.h | 4 +++-
> src/input/player.c   | 6 +++---
> 2 files changed, 6 insertions(+), 4 deletions(-)
>
>diff --git a/include/vlc_player.h b/include/vlc_player.h
>index 054c4abae3..a7ad520bed 100644
>--- a/include/vlc_player.h
>+++ b/include/vlc_player.h
>@@ -1206,8 +1206,10 @@ vlc_player_Start(vlc_player_t *player);
>  * STOPPED state event to know when the stop is finished.
>  *
>  * @param player locked player instance
>+ * @return false if already stopped, true if the player is stopping
>+ * asynchronously
>  */
>-VLC_API void
>+VLC_API bool
> vlc_player_Stop(vlc_player_t *player);
> 
> /**
>diff --git a/src/input/player.c b/src/input/player.c
>index e81c717f36..6796b07e07 100644
>--- a/src/input/player.c
>+++ b/src/input/player.c
>@@ -2217,7 +2217,7 @@ vlc_player_Start(vlc_player_t *player)
>     return ret;
> }
> 
>-void
>+bool
> vlc_player_Stop(vlc_player_t *player)
> {
>  struct vlc_player_input *input = vlc_player_get_input_locked(player);
>@@ -2227,12 +2227,12 @@ vlc_player_Stop(vlc_player_t *player)
>     vlc_player_InvalidateNextMedia(player);
> 
>     if (!input || !player->started)
>-        return;
>+        return false;
>     player->started = false;
> 
>     vlc_player_destructor_AddInput(player, input);
>     player->input = NULL;
>-
>+    return true;
> }
> 
> void
>-- 
>2.20.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190515/69bafac5/attachment.html>


More information about the vlc-devel mailing list