player: Only set the pipeline to PLAYING in play() if buffering>=100%

Otherwise the application can break the buffering logic by setting the
pipeline to PLAYING before we buffered enough.
This commit is contained in:
Sebastian Dröge 2016-01-06 16:54:49 +02:00
parent fce10c44ae
commit 7f8d9d1df2

View file

@ -2546,7 +2546,8 @@ gst_player_play_internal (gpointer user_data)
if (self->current_state < GST_STATE_PAUSED)
change_state (self, GST_PLAYER_STATE_BUFFERING);
if (self->current_state >= GST_STATE_PAUSED && !self->is_eos) {
if (self->current_state >= GST_STATE_PAUSED && !self->is_eos
&& self->buffering >= 100) {
state_ret = gst_element_set_state (self->playbin, GST_STATE_PLAYING);
} else {
state_ret = gst_element_set_state (self->playbin, GST_STATE_PAUSED);