diff --git a/src/lib/clapper/clapper-playbin-bus.c b/src/lib/clapper/clapper-playbin-bus.c index 0113904d..cc42992f 100644 --- a/src/lib/clapper/clapper-playbin-bus.c +++ b/src/lib/clapper/clapper-playbin-bus.c @@ -755,7 +755,7 @@ _handle_stream_change_msg (GstMessage *msg, && player->current_state >= GST_STATE_PAUSED) { /* XXX: I am not sure if we "officially" need to flush seek after select * streams, but as of GStreamer 1.22 it doesn't work otherwise. */ - _perform_flush_seek (player); + player->pending_flush = TRUE; } g_list_free (list); } @@ -1021,6 +1021,13 @@ _handle_streams_selected_msg (GstMessage *msg, ClapperPlayer *player) * we iterate in search for all active ones */ clapper_player_playbin_update_current_decoders (player); } + + if (player->pending_flush) { + player->pending_flush = FALSE; + + if (player->current_state >= GST_STATE_PAUSED) + _perform_flush_seek (player); + } } static inline void diff --git a/src/lib/clapper/clapper-player-private.h b/src/lib/clapper/clapper-player-private.h index 43116cd2..21ef21a9 100644 --- a/src/lib/clapper/clapper-player-private.h +++ b/src/lib/clapper/clapper-player-private.h @@ -85,6 +85,7 @@ struct _ClapperPlayer gboolean seeking; // during seek operation gboolean speed_changing; // during rate change operation gboolean pending_eos; // when pausing due to EOS + gboolean pending_flush; // after another stream selection gint eos; // atomic integer /* Set adaptive props immediately */ diff --git a/src/lib/clapper/clapper-player.c b/src/lib/clapper/clapper-player.c index 52f4e22c..217b1d07 100644 --- a/src/lib/clapper/clapper-player.c +++ b/src/lib/clapper/clapper-player.c @@ -751,6 +751,7 @@ clapper_player_reset (ClapperPlayer *self, gboolean pending_dispose) GST_DEBUG_OBJECT (self, "Reset"); self->had_error = FALSE; + self->pending_flush = FALSE; gst_clear_object (&self->played_item); if (pending_dispose) {