mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 23:32:04 +02:00
clapper: Wait with flush after streams are selected
Instead flushing right after select streams request, wait until they are selected before doing a flush. This fixes a hang when changing audio language with hlsdemux2.
This commit is contained in:
@@ -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
|
||||
|
@@ -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 */
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user