Commit ec03185b authored by Thomas Guillem's avatar Thomas Guillem

libvlc: media: deprecate libvlc_Buffering state

This state was never set or used. If it was set, it would have overridden the
media state since a media can be buffering while opening or during playback
(while seeking).

PS: Listen to the libvlc_MediaPlayerBuffering event if you want to know if a
media player is buffering.
parent 86a419d7
...@@ -85,14 +85,16 @@ typedef enum libvlc_meta_t { ...@@ -85,14 +85,16 @@ typedef enum libvlc_meta_t {
* and VideoLAN.LibVLC.State (at bindings/cil/src/media.cs). * and VideoLAN.LibVLC.State (at bindings/cil/src/media.cs).
* *
* Expected states by web plugins are: * Expected states by web plugins are:
* IDLE/CLOSE=0, OPENING=1, BUFFERING=2, PLAYING=3, PAUSED=4, * IDLE/CLOSE=0, OPENING=1, PLAYING=3, PAUSED=4,
* STOPPING=5, ENDED=6, ERROR=7 * STOPPING=5, ENDED=6, ERROR=7
*/ */
typedef enum libvlc_state_t typedef enum libvlc_state_t
{ {
libvlc_NothingSpecial=0, libvlc_NothingSpecial=0,
libvlc_Opening, libvlc_Opening,
libvlc_Buffering, libvlc_Buffering, /* XXX: Deprecated value. Check the
* libvlc_MediaPlayerBuffering event to know the
* buffering state of a libvlc_media_player */
libvlc_Playing, libvlc_Playing,
libvlc_Paused, libvlc_Paused,
libvlc_Stopped, libvlc_Stopped,
......
...@@ -666,8 +666,7 @@ int ...@@ -666,8 +666,7 @@ int
libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp) libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp)
{ {
libvlc_state_t state = libvlc_media_player_get_state(p_mlp->p_mi); libvlc_state_t state = libvlc_media_player_get_state(p_mlp->p_mi);
return (state == libvlc_Opening) || (state == libvlc_Buffering) || return (state == libvlc_Opening) || (state == libvlc_Playing);
(state == libvlc_Playing);
} }
/************************************************************************** /**************************************************************************
......
...@@ -954,7 +954,7 @@ void libvlc_media_player_set_pause( libvlc_media_player_t *p_mi, int paused ) ...@@ -954,7 +954,7 @@ void libvlc_media_player_set_pause( libvlc_media_player_t *p_mi, int paused )
return; return;
libvlc_state_t state = libvlc_media_player_get_state( p_mi ); libvlc_state_t state = libvlc_media_player_get_state( p_mi );
if( state == libvlc_Playing || state == libvlc_Buffering ) if( state == libvlc_Playing )
{ {
if( paused ) if( paused )
{ {
...@@ -978,10 +978,7 @@ void libvlc_media_player_set_pause( libvlc_media_player_t *p_mi, int paused ) ...@@ -978,10 +978,7 @@ void libvlc_media_player_set_pause( libvlc_media_player_t *p_mi, int paused )
**************************************************************************/ **************************************************************************/
void libvlc_media_player_pause( libvlc_media_player_t *p_mi ) void libvlc_media_player_pause( libvlc_media_player_t *p_mi )
{ {
libvlc_state_t state = libvlc_media_player_get_state( p_mi ); libvlc_media_player_set_pause( p_mi, libvlc_media_player_is_playing( p_mi ) );
bool playing = (state == libvlc_Playing || state == libvlc_Buffering);
libvlc_media_player_set_pause( p_mi, playing );
} }
/************************************************************************** /**************************************************************************
...@@ -992,7 +989,7 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi ) ...@@ -992,7 +989,7 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi )
int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi ) int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi )
{ {
libvlc_state_t state = libvlc_media_player_get_state( p_mi ); libvlc_state_t state = libvlc_media_player_get_state( p_mi );
return (libvlc_Playing == state) || (libvlc_Buffering == state); return libvlc_Playing == state;
} }
/************************************************************************** /**************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment