mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
pad: Don't fail latency query on unlinked pads
A single unlinked pad can make the latency query fail across the pipeline, which is probably not desirable. Instead, we return a default anything goes value. Perhaps we should also be emitting a gst_message_new_latency() when a PLAYING element has one of its pads linked. https://bugzilla.gnome.org/show_bug.cgi?id=745197
This commit is contained in:
parent
c1d2254b23
commit
be36d34aee
1 changed files with 13 additions and 4 deletions
17
gst/gstpad.c
17
gst/gstpad.c
|
@ -3061,13 +3061,19 @@ static gboolean
|
||||||
query_latency_default_fold (const GValue * item, GValue * ret,
|
query_latency_default_fold (const GValue * item, GValue * ret,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GstPad *pad = g_value_get_object (item);
|
GstPad *pad = g_value_get_object (item), *peer;
|
||||||
LatencyFoldData *fold_data = user_data;
|
LatencyFoldData *fold_data = user_data;
|
||||||
GstQuery *query;
|
GstQuery *query;
|
||||||
gboolean res;
|
gboolean res = FALSE;
|
||||||
|
|
||||||
query = gst_query_new_latency ();
|
query = gst_query_new_latency ();
|
||||||
res = gst_pad_peer_query (pad, query);
|
|
||||||
|
peer = gst_pad_get_peer (pad);
|
||||||
|
if (peer) {
|
||||||
|
res = gst_pad_peer_query (pad, query);
|
||||||
|
} else {
|
||||||
|
GST_LOG_OBJECT (pad, "No peer pad found, ignoring this pad");
|
||||||
|
}
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
gboolean live;
|
gboolean live;
|
||||||
|
@ -3089,11 +3095,14 @@ query_latency_default_fold (const GValue * item, GValue * ret,
|
||||||
|
|
||||||
fold_data->live = TRUE;
|
fold_data->live = TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (peer) {
|
||||||
GST_DEBUG_OBJECT (pad, "latency query failed");
|
GST_DEBUG_OBJECT (pad, "latency query failed");
|
||||||
g_value_set_boolean (ret, FALSE);
|
g_value_set_boolean (ret, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_query_unref (query);
|
gst_query_unref (query);
|
||||||
|
if (peer)
|
||||||
|
gst_object_unref (peer);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue