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.
This commit is contained in:
Wim Taymans 2007-08-03 16:08:56 +00:00
parent bed7c0fc11
commit a654ab9f49
2 changed files with 24 additions and 5 deletions

View file

@ -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> 2007-07-30 Tim-Philipp Müller <tim at centricular dot net>
* po/POTFILES.skip: * po/POTFILES.skip:

View file

@ -646,7 +646,7 @@ gst_rtspsrc_cleanup (GstRTSPSrc * src)
/* FIXME, this should go somewhere else, ideally /* FIXME, this should go somewhere else, ideally
*/ */
static guint static guint
get_default_rate_for_pt (gint pt) get_default_rate_for_pt (gint pt, gchar * name, gchar * params)
{ {
switch (pt) { switch (pt) {
case 0: case 0:
@ -680,7 +680,11 @@ get_default_rate_for_pt (gint pt)
case 34: case 34:
return 90000; return 90000;
default: default:
{
if (g_str_has_prefix (name, "x-pn-real"))
return 1000;
return -1; return -1;
}
} }
} }
@ -701,8 +705,10 @@ G_STMT_START { \
G_STMT_START { \ G_STMT_START { \
gchar *t = p; \ gchar *t = p; \
p = strstr (p, del); \ p = strstr (p, del); \
if (p == NULL) \ if (p == NULL) { \
res = NULL; \ res = NULL; \
p = t; \
} \
else { \ else { \
*p = '\0'; \ *p = '\0'; \
p++; \ p++; \
@ -736,6 +742,7 @@ gst_rtspsrc_parse_rtpmap (const gchar * rtpmap, gint * payload, gchar ** name,
PARSE_STRING (p, "/", *name); PARSE_STRING (p, "/", *name);
if (*name == NULL) { if (*name == NULL) {
GST_DEBUG ("no rate, name %s", p);
/* no rate, assume -1 then */ /* no rate, assume -1 then */
*name = p; *name = p;
*rate = -1; *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 /* check if we have a rate, if not, we need to look up the rate from the
* default rates based on the payload types. */ * default rates based on the payload types. */
if (rate == -1) { 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 */ /* we fail if we cannot find one */
if (rate == -1) if (rate == -1)
goto no_rate; goto no_rate;
@ -1634,7 +1641,8 @@ gst_rtspsrc_stream_configure_tcp (GstRTSPSrc * src, GstRTSPStream * stream,
g_free (name); g_free (name);
/* and link */ /* and link */
gst_pad_link (pad, stream->rtcppad); if (pad)
gst_pad_link (pad, stream->rtcppad);
} }
return TRUE; return TRUE;
} }
@ -1806,7 +1814,8 @@ gst_rtspsrc_stream_configure_udp_sink (GstRTSPSrc * src, GstRTSPStream * stream,
g_free (name); g_free (name);
/* and link */ /* and link */
gst_pad_link (pad, stream->rtcppad); if (pad)
gst_pad_link (pad, stream->rtcppad);
return TRUE; return TRUE;