rtsp: only add ports when not using TCP

Only add the port numbers in the transport string when we are using udp or
multicast.
This commit is contained in:
Wim Taymans 2009-03-09 13:53:41 +01:00
parent bc54a5f9a0
commit f964c0fc38

View file

@ -544,6 +544,7 @@ gst_rtsp_transport_as_text (GstRTSPTransport * transport)
if ((tmp = rtsp_transport_ltrans_as_text (transport)) == NULL) if ((tmp = rtsp_transport_ltrans_as_text (transport)) == NULL)
goto invalid_transport; goto invalid_transport;
g_ptr_array_add (strs, g_ascii_strup (tmp, -1)); g_ptr_array_add (strs, g_ascii_strup (tmp, -1));
} }
@ -601,32 +602,36 @@ gst_rtsp_transport_as_text (GstRTSPTransport * transport)
} }
/* add the port parameter */ /* add the port parameter */
if (transport->trans == GST_RTSP_TRANS_RTP && transport->port.min >= 0) { if (transport->lower_transport != GST_RTSP_LOWER_TRANS_TCP) {
if (transport->port.min < 65536 && transport->port.max < 65536) { if (transport->trans == GST_RTSP_TRANS_RTP && transport->port.min >= 0) {
g_ptr_array_add (strs, g_strdup (";port=")); if (transport->port.min < 65536 && transport->port.max < 65536) {
g_ptr_array_add (strs, range_as_text (&transport->port)); g_ptr_array_add (strs, g_strdup (";port="));
} else g_ptr_array_add (strs, range_as_text (&transport->port));
goto invalid_transport; } else
} goto invalid_transport;
}
/* add the client_port parameter */ /* add the client_port parameter */
if (transport->trans == GST_RTSP_TRANS_RTP && transport->client_port.min >= 0) { if (transport->trans == GST_RTSP_TRANS_RTP
if (transport->client_port.min < 65536 && && transport->client_port.min >= 0) {
transport->client_port.max < 65536) { if (transport->client_port.min < 65536
g_ptr_array_add (strs, g_strdup (";client_port=")); && transport->client_port.max < 65536) {
g_ptr_array_add (strs, range_as_text (&transport->client_port)); g_ptr_array_add (strs, g_strdup (";client_port="));
} else g_ptr_array_add (strs, range_as_text (&transport->client_port));
goto invalid_transport; } else
} goto invalid_transport;
}
/* add the server_port parameter */ /* add the server_port parameter */
if (transport->trans == GST_RTSP_TRANS_RTP && transport->server_port.min >= 0) { if (transport->trans == GST_RTSP_TRANS_RTP
if (transport->server_port.min < 65536 && && transport->server_port.min >= 0) {
transport->server_port.max < 65536) { if (transport->server_port.min < 65536
g_ptr_array_add (strs, g_strdup (";server_port=")); && transport->server_port.max < 65536) {
g_ptr_array_add (strs, range_as_text (&transport->server_port)); g_ptr_array_add (strs, g_strdup (";server_port="));
} else g_ptr_array_add (strs, range_as_text (&transport->server_port));
goto invalid_transport; } else
goto invalid_transport;
}
} }
/* add the ssrc parameter */ /* add the ssrc parameter */