summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Jinghua <sunmoon1997@gmail.com>2010-11-26 15:08:22 +0800
committerLuo Jinghua <sunmoon1997@gmail.com>2010-11-26 15:08:22 +0800
commit74cdcda9cae5449441eed9318376e574072471b4 (patch)
tree73391534e9f324965085ce2239d36eb00b6777dd
parent17fcd36b3ca770ddbe9ca5aa2f098ff7c3d4419b (diff)
ppssrc: extract fid from the urlHEADmaster
-rw-r--r--src/gstppssrc.c26
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;
}