sdp: don't add encoding name when absent in caps

This commit is contained in:
Wim Taymans 2009-05-24 19:33:22 +02:00 committed by Wim Taymans
parent 740d71bd50
commit 415e5e674b

View file

@ -87,14 +87,16 @@ gst_rtsp_sdp_from_media (GstRTSPMedia *media)
caps_enc = gst_structure_get_string (s, "encoding-name"); caps_enc = gst_structure_get_string (s, "encoding-name");
caps_params = gst_structure_get_string (s, "encoding-params"); caps_params = gst_structure_get_string (s, "encoding-params");
if (caps_params) if (caps_enc) {
tmp = g_strdup_printf ("%d %s/%d/%s", caps_pt, caps_enc, caps_rate, if (caps_params)
tmp = g_strdup_printf ("%d %s/%d/%s", caps_pt, caps_enc, caps_rate,
caps_params); caps_params);
else else
tmp = g_strdup_printf ("%d %s/%d", caps_pt, caps_enc, caps_rate); tmp = g_strdup_printf ("%d %s/%d", caps_pt, caps_enc, caps_rate);
gst_sdp_media_add_attribute (smedia, "rtpmap", tmp); gst_sdp_media_add_attribute (smedia, "rtpmap", tmp);
g_free (tmp); g_free (tmp);
}
/* the config uri */ /* the config uri */
tmp = g_strdup_printf ("stream=%d", i); tmp = g_strdup_printf ("stream=%d", i);