mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
uridecodebin3: Handle potential double redirection errors
Some elements (like qtdemux) might post a redirection error message twice. We only want to handle it once. Fixes #3390 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6389>
This commit is contained in:
parent
324563b158
commit
c1ac015325
1 changed files with 12 additions and 5 deletions
|
@ -149,6 +149,9 @@ struct _GstSourceHandler
|
||||||
|
|
||||||
/* List of GstSourcePad */
|
/* List of GstSourcePad */
|
||||||
GList *sourcepads;
|
GList *sourcepads;
|
||||||
|
|
||||||
|
/* If we saw a redirection message from this source. */
|
||||||
|
gboolean saw_redirection;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Structure wrapping everything related to a urisourcebin pad */
|
/* Structure wrapping everything related to a urisourcebin pad */
|
||||||
|
@ -2167,11 +2170,15 @@ gst_uri_decode_bin3_handle_redirection (GstURIDecodeBin3 * uridecodebin,
|
||||||
|
|
||||||
if (g_strcmp0 (current_uri, uri)) {
|
if (g_strcmp0 (current_uri, uri)) {
|
||||||
gboolean was_instant = uridecodebin->instant_uri;
|
gboolean was_instant = uridecodebin->instant_uri;
|
||||||
|
/* We only want to handle the redirection once */
|
||||||
|
if (!handler->saw_redirection) {
|
||||||
|
handler->saw_redirection = TRUE;
|
||||||
GST_DEBUG_OBJECT (uridecodebin, "Doing instant switch to '%s'", uri);
|
GST_DEBUG_OBJECT (uridecodebin, "Doing instant switch to '%s'", uri);
|
||||||
uridecodebin->instant_uri = TRUE;
|
uridecodebin->instant_uri = TRUE;
|
||||||
/* Force instant switch */
|
/* Force instant switch */
|
||||||
gst_uri_decode_bin3_set_uri (uridecodebin, uri);
|
gst_uri_decode_bin3_set_uri (uridecodebin, uri);
|
||||||
uridecodebin->instant_uri = was_instant;
|
uridecodebin->instant_uri = was_instant;
|
||||||
|
}
|
||||||
gst_message_unref (message);
|
gst_message_unref (message);
|
||||||
message = NULL;
|
message = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue