[FFmpeg-devel] Network patch for testing

Luca Abeni lucabe72
Mon Aug 20 11:10:19 CEST 2007


Hi Michael,

Michael Niedermayer wrote:
[...]
>>  #else
>> -    if (s->is_multicast && !(h->flags & URL_WRONLY))
>> +    s->is_multicast = IN6_IS_ADDR_MULTICAST(&(((struct sockaddr_in6 *)&s->dest_addr)->sin6_addr));
>> +    if (!(h->flags & URL_WRONLY))
>>          s->local_port = port;
>>      udp_fd = udp_ipv6_set_local(h);
>>      if (udp_fd < 0)
> 
> these 2 hunks change more then just "find is_multicast from IP"
You are right, they should go in a separate patch. When I sent the patch 
for testing, I put all the network-related changes in it, and I forgot 
to mention this change.

> could you elaborate on them?
After fixing multicast addresses detection, I noticed that ffplay was 
still not able to receive unicast RTP streams... This is what happens:
- Let's assume someone streams some video to 127.0.0.1, on port 10000
- libavformat/rtsp.c:sdp_parse() finds the destination address and port
   in the SDP, and libavformat/rtsp.c:sdp_read_header() forges an URI
   rtp://<addr>:<port>?ttl=..."
- udp_open() then tries to bind on a different port number, so no data
   is received.

The problem could be fixed in different ways (for example, by setting 
"local_port" in the URI for unicast streams), but it was not clear to me 
why "port" should be considered differently for multicast streams... So, 
I removed "is_multicast" from the if() condition (I do not think this 
breaks anything, but I am not sure... This is why I asked people for 
some testing :)

			Thanks,
				Luca




More information about the ffmpeg-devel mailing list