[vlc-devel] libvlc_media_get_state - buffering state never set

Thomas Guillem thomas at gllm.fr
Fri Apr 8 18:14:56 CEST 2016

On Thu, Apr 7, 2016, at 23:43, Olivier Aubert wrote:
> Hi
> I got a bug report from a python bindings user, about the
> libvlc_media_get_state function returning a libvlc_Playing state even
> when a stream (http in this case) is buffering. The documentation
> states (implies) that it should return a libvlc_Buffering state. The
> python bindings are rather straightforward there, so I suspect a libvlc
> issue.
> Indeed, after inspecting the source code (basically with a 
> git grep libvlc_Buffering) I realized that libvlc_Buffering is never
> used to set the state, it is only checked in conditions (except if some
> implicit magic/conversion takes place, which would be a bad thing
> anyway). Hence the libvlc_media_get_state can never return it.
> I am not acquainted enough with the input code (from which the state is
> set) to determine the difficulty of fixing this issue.
> Anyone has an idea ?


I looked at it, I was about to fix it, but I realised that this state
was wrong and should not be used. 

Indeed, a media could be buffering while opening or while playing (if
you seek). And you don't want to mess with the playing/paused state if
you seek. So, Either we add a libvlc_media_is_buffering() along with the
libvlc_media_get_state(), or you listen to the
libvlc_MediaPlayerBuffering event. I prefer the second solution and I'll
propose a patch to remove the buffering state inside libvlc_media.


> Olivier
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list