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

Thomas Guillem thomas at gllm.fr
Wed May 15 12:42:08 CEST 2019


On Wed, May 15, 2019, at 12:29, Rémi Denis-Courmont wrote:
> Hi,
> 
> Entropy-wise, it makes sense. But not stopped yet sounds more like a case for returning EAGAIN (vs 0) than true, IMO.

OK

> 
> 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
> 
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190515/6520f74b/attachment.html>


More information about the vlc-devel mailing list