summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-08-03 16:08:56 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-08-03 16:08:56 +0000
commita654ab9f4965b9e5f8ff7ba4fadf6755bf6a12fa (patch)
tree576fb5057c09961c710dee178461c927f5e6d38c
parentbed7c0fc117c864c3acba8356785f2955560e02d (diff)
gst/rtsp/gstrtspsrc.c: Fix default clock-rate for realmedia.
Original commit message from CVS: * gst/rtsp/gstrtspsrc.c: (get_default_rate_for_pt), (gst_rtspsrc_parse_rtpmap), (gst_rtspsrc_media_to_caps), (gst_rtspsrc_stream_configure_tcp), (gst_rtspsrc_stream_configure_udp_sink): Fix default clock-rate for realmedia. Fix parsing of transport. Don't try to link NULL pads.
-rw-r--r--ChangeLog10
-rw-r--r--gst/rtsp/gstrtspsrc.c19
2 files changed, 24 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 415243f8..ddc90930 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-08-03 Wim Taymans <wim.taymans@gmail.com>
+
+ * gst/rtsp/gstrtspsrc.c: (get_default_rate_for_pt),
+ (gst_rtspsrc_parse_rtpmap), (gst_rtspsrc_media_to_caps),
+ (gst_rtspsrc_stream_configure_tcp),
+ (gst_rtspsrc_stream_configure_udp_sink):
+ Fix default clock-rate for realmedia.
+ Fix parsing of transport.
+ Don't try to link NULL pads.
+
2007-07-30 Tim-Philipp Müller <tim at centricular dot net>
* po/POTFILES.skip:
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 07323fd2..e02114e5 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -646,7 +646,7 @@ gst_rtspsrc_cleanup (GstRTSPSrc * src)
/* FIXME, this should go somewhere else, ideally
*/
static guint
-get_default_rate_for_pt (gint pt)
+get_default_rate_for_pt (gint pt, gchar * name, gchar * params)
{
switch (pt) {
case 0:
@@ -680,7 +680,11 @@ get_default_rate_for_pt (gint pt)
case 34:
return 90000;
default:
+ {
+ if (g_str_has_prefix (name, "x-pn-real"))
+ return 1000;
return -1;
+ }
}
}
@@ -701,8 +705,10 @@ G_STMT_START { \
G_STMT_START { \
gchar *t = p; \
p = strstr (p, del); \
- if (p == NULL) \
+ if (p == NULL) { \
res = NULL; \
+ p = t; \
+ } \
else { \
*p = '\0'; \
p++; \
@@ -736,6 +742,7 @@ gst_rtspsrc_parse_rtpmap (const gchar * rtpmap, gint * payload, gchar ** name,
PARSE_STRING (p, "/", *name);
if (*name == NULL) {
+ GST_DEBUG ("no rate, name %s", p);
/* no rate, assume -1 then */
*name = p;
*rate = -1;
@@ -808,7 +815,7 @@ gst_rtspsrc_media_to_caps (gint pt, const GstSDPMedia * media)
/* check if we have a rate, if not, we need to look up the rate from the
* default rates based on the payload types. */
if (rate == -1) {
- rate = get_default_rate_for_pt (pt);
+ rate = get_default_rate_for_pt (pt, name, params);
/* we fail if we cannot find one */
if (rate == -1)
goto no_rate;
@@ -1634,7 +1641,8 @@ gst_rtspsrc_stream_configure_tcp (GstRTSPSrc * src, GstRTSPStream * stream,
g_free (name);
/* and link */
- gst_pad_link (pad, stream->rtcppad);
+ if (pad)
+ gst_pad_link (pad, stream->rtcppad);
}
return TRUE;
}
@@ -1806,7 +1814,8 @@ gst_rtspsrc_stream_configure_udp_sink (GstRTSPSrc * src, GstRTSPStream * stream,
g_free (name);
/* and link */
- gst_pad_link (pad, stream->rtcppad);
+ if (pad)
+ gst_pad_link (pad, stream->rtcppad);
return TRUE;