Revert "playbin2: Only allow to set the URIs in states <= READY or from an about-to-finish signal handler"
This reverts commit 7335ce5d3e03c126a417a721571cb6f3af136ecf. Support abusing the uri property to configure the next uri to play outside of the about-to-finish handler for the time being after all. We also shouldn't use thread private structures for this, since it should be possible to block the thread that emitted about-to-finish while the main thread sets the uri property. See #607226.
This commit is contained in:
parent
4914aeda2f
commit
729b6da76a
@ -555,12 +555,6 @@ static void gst_play_bin_suburidecodebin_block (GstElement * suburidecodebin,
|
|||||||
static void gst_play_bin_suburidecodebin_seek_to_start (GstElement *
|
static void gst_play_bin_suburidecodebin_seek_to_start (GstElement *
|
||||||
suburidecodebin);
|
suburidecodebin);
|
||||||
|
|
||||||
/* This is non-NULL if the current thread is inside an about-to-finish signal handler,
|
|
||||||
* which is the only place where the currently set URI or subtitle URI is allowed
|
|
||||||
* to be changed in states >= PAUSED.
|
|
||||||
*/
|
|
||||||
static GStaticPrivate _in_about_to_finish_handler = G_STATIC_PRIVATE_INIT;
|
|
||||||
|
|
||||||
static GstElementClass *parent_class;
|
static GstElementClass *parent_class;
|
||||||
|
|
||||||
static guint gst_play_bin_signals[LAST_SIGNAL] = { 0 };
|
static guint gst_play_bin_signals[LAST_SIGNAL] = { 0 };
|
||||||
@ -1231,19 +1225,12 @@ static void
|
|||||||
gst_play_bin_set_uri (GstPlayBin * playbin, const gchar * uri)
|
gst_play_bin_set_uri (GstPlayBin * playbin, const gchar * uri)
|
||||||
{
|
{
|
||||||
GstSourceGroup *group;
|
GstSourceGroup *group;
|
||||||
gboolean in_about_to_finish_handler;
|
|
||||||
|
|
||||||
in_about_to_finish_handler
|
|
||||||
= g_static_private_get (&_in_about_to_finish_handler) != NULL;
|
|
||||||
|
|
||||||
if (uri == NULL) {
|
if (uri == NULL) {
|
||||||
g_warning ("cannot set NULL uri");
|
g_warning ("cannot set NULL uri");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_return_if_fail (GST_STATE (playbin) < GST_STATE_PAUSED ||
|
|
||||||
in_about_to_finish_handler);
|
|
||||||
|
|
||||||
GST_PLAY_BIN_LOCK (playbin);
|
GST_PLAY_BIN_LOCK (playbin);
|
||||||
group = playbin->next_group;
|
group = playbin->next_group;
|
||||||
|
|
||||||
@ -1262,13 +1249,6 @@ static void
|
|||||||
gst_play_bin_set_suburi (GstPlayBin * playbin, const gchar * suburi)
|
gst_play_bin_set_suburi (GstPlayBin * playbin, const gchar * suburi)
|
||||||
{
|
{
|
||||||
GstSourceGroup *group;
|
GstSourceGroup *group;
|
||||||
gboolean in_about_to_finish_handler;
|
|
||||||
|
|
||||||
in_about_to_finish_handler
|
|
||||||
= g_static_private_get (&_in_about_to_finish_handler) != NULL;
|
|
||||||
|
|
||||||
g_return_if_fail (GST_STATE (playbin) < GST_STATE_PAUSED ||
|
|
||||||
in_about_to_finish_handler);
|
|
||||||
|
|
||||||
GST_PLAY_BIN_LOCK (playbin);
|
GST_PLAY_BIN_LOCK (playbin);
|
||||||
group = playbin->next_group;
|
group = playbin->next_group;
|
||||||
@ -2956,11 +2936,9 @@ drained_cb (GstElement * decodebin, GstSourceGroup * group)
|
|||||||
|
|
||||||
GST_DEBUG_OBJECT (playbin, "about to finish in group %p", group);
|
GST_DEBUG_OBJECT (playbin, "about to finish in group %p", group);
|
||||||
|
|
||||||
g_static_private_set (&_in_about_to_finish_handler, (gpointer) 1, NULL);
|
|
||||||
/* after this call, we should have a next group to activate or we EOS */
|
/* after this call, we should have a next group to activate or we EOS */
|
||||||
g_signal_emit (G_OBJECT (playbin),
|
g_signal_emit (G_OBJECT (playbin),
|
||||||
gst_play_bin_signals[SIGNAL_ABOUT_TO_FINISH], 0, NULL);
|
gst_play_bin_signals[SIGNAL_ABOUT_TO_FINISH], 0, NULL);
|
||||||
g_static_private_set (&_in_about_to_finish_handler, NULL, NULL);
|
|
||||||
|
|
||||||
/* now activate the next group. If the app did not set a uri, this will
|
/* now activate the next group. If the app did not set a uri, this will
|
||||||
* fail and we can do EOS */
|
* fail and we can do EOS */
|
||||||
@ -3665,8 +3643,6 @@ gst_play_bin2_plugin_init (GstPlugin * plugin)
|
|||||||
g_type_class_ref (gst_input_selector_get_type ());
|
g_type_class_ref (gst_input_selector_get_type ());
|
||||||
g_type_class_ref (gst_selector_pad_get_type ());
|
g_type_class_ref (gst_selector_pad_get_type ());
|
||||||
|
|
||||||
g_static_private_set (&_in_about_to_finish_handler, NULL, NULL);
|
|
||||||
|
|
||||||
return gst_element_register (plugin, "playbin2", GST_RANK_NONE,
|
return gst_element_register (plugin, "playbin2", GST_RANK_NONE,
|
||||||
GST_TYPE_PLAY_BIN);
|
GST_TYPE_PLAY_BIN);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user