Commit 94f95f8f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

RTP: over UDP, assume we have the destination if there is no @

Previously, we'd assume we have the source address, which was confusing.
parent 20c21aac
...@@ -170,16 +170,25 @@ static int Open (vlc_object_t *obj) ...@@ -170,16 +170,25 @@ static int Open (vlc_object_t *obj)
return VLC_EGENERIC; return VLC_EGENERIC;
char *tmp = strdup (demux->psz_path); char *tmp = strdup (demux->psz_path);
char *shost = tmp; if (tmp == NULL)
if (shost == NULL)
return VLC_ENOMEM; return VLC_ENOMEM;
char *dhost = strchr (shost, '@'); char *shost;
if (dhost) char *dhost = strchr (tmp, '@');
*dhost++ = '\0'; if (dhost != NULL)
{
*(dhost++) = '\0';
shost = tmp;
}
else
{
dhost = tmp;
shost = NULL;
}
/* Parses the port numbers */ /* Parses the port numbers */
int sport = 0, dport = 0; int sport = 0, dport = 0;
if (shost != NULL)
sport = extract_port (&shost); sport = extract_port (&shost);
if (dhost != NULL) if (dhost != NULL)
dport = extract_port (&dhost); dport = extract_port (&dhost);
...@@ -213,14 +222,14 @@ static int Open (vlc_object_t *obj) ...@@ -213,14 +222,14 @@ static int Open (vlc_object_t *obj)
#ifdef SOCK_DCCP #ifdef SOCK_DCCP
var_Create (obj, "dccp-service", VLC_VAR_STRING); var_Create (obj, "dccp-service", VLC_VAR_STRING);
var_SetString (obj, "dccp-service", "RTPV"); /* FIXME: RTPA? */ var_SetString (obj, "dccp-service", "RTPV"); /* FIXME: RTPA? */
fd = net_Connect (obj, shost, sport, SOCK_DCCP, tp); fd = net_Connect (obj, dhost, dport, SOCK_DCCP, tp);
#else #else
msg_Err (obj, "DCCP support not included"); msg_Err (obj, "DCCP support not included");
#endif #endif
break; break;
case IPPROTO_TCP: case IPPROTO_TCP:
fd = net_Connect (obj, shost, sport, SOCK_STREAM, tp); fd = net_Connect (obj, dhost, dport, SOCK_STREAM, tp);
break; break;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment