diff options
-rw-r--r-- | src/gstppssrc.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/gstppssrc.c b/src/gstppssrc.c index 88ba71b..943690d 100644 --- a/src/gstppssrc.c +++ b/src/gstppssrc.c @@ -1160,16 +1160,38 @@ free_uri: return result; } +static gchar * +gst_ppssrc_uri_extract_fid (const gchar * uri, int *fid) +{ + gchar *s; + gchar *end; + + s = strstr (uri, "?fid="); + if (!s) + s = strstr (uri, "&fid="); + if (!s) + return g_strdup (uri); + + *fid = g_ascii_strtoll (s + 5, &end, 10); + return g_strdup_printf ("%.*s%s", (int) (s - uri), uri, end); +} + static gboolean -gst_pps_src_set_location (GstPpsSrc * src, const gchar * uri) +gst_pps_src_set_location (GstPpsSrc * src, const gchar * _uri) { + int fid = 0; + gchar *uri = gst_ppssrc_uri_extract_fid (_uri, &fid); + + GST_DEBUG_OBJECT (src, "location: %s fid: %d.", uri, fid); + g_free (src->location); g_free (src->transformed_location); src->location = gst_pps_src_recode_uri (uri); - src->transformed_location = gst_pps_src_transform_uri (uri, 0); + src->transformed_location = gst_pps_src_transform_uri (uri, fid); src->location_changed = TRUE; + g_free (uri); return TRUE; } |