Skip to content

Commit

Permalink
gst: src: Response to URI query with "nodata"
Browse files Browse the repository at this point in the history
This way upstream elements will not complain about not having a valid manifest URI
and also will not try to fetch something that does not actually lead to manifest.

This fixes playback with custom URI schemes.
  • Loading branch information
Rafał Dzięgiel committed Dec 6, 2023
1 parent de0e271 commit 29b2883
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions gst/gst-gtuber/gstgtubersrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,16 @@ gst_gtuber_src_create (GstPushSrc *push_src, GstBuffer **outbuf)
return GST_FLOW_OK;
}

static inline gboolean
_handle_uri_query (GstGtuberSrc *self, GstQuery *query)
{
/* Since our URI doesn't actually lead to manifest data, we answer
* with "nodata" equivalent, so upstream will not try to fetch it */
gst_query_set_uri (query, "data:,");

return TRUE;
}

static gboolean
gst_gtuber_src_query (GstBaseSrc *base_src, GstQuery *query)
{
Expand All @@ -717,18 +727,9 @@ gst_gtuber_src_query (GstBaseSrc *base_src, GstQuery *query)

switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_URI:
if (GST_IS_URI_HANDLER (self)) {
gchar *uri;

uri = gst_uri_handler_get_uri (GST_URI_HANDLER (self));
gst_query_set_uri (query, uri);

g_free (uri);
ret = TRUE;
}
ret = _handle_uri_query (self, query);
break;
default:
ret = FALSE;
break;
}

Expand Down

0 comments on commit 29b2883

Please sign in to comment.