[FFmpeg-devel] Strange code in libavformat/udp.c:udp_open()

Luca Abeni lucabe72
Fri Jul 13 16:18:11 CEST 2007

Hi all,

in libavformat/udp.c:udp_open() there is something like:
	s->is_multicast = find_info_tag(buf, sizeof(buf), "multicast", p);
does anyone know why "is_multicast" is not set according to the 
destination IP address (using the IN_MULTICAST() macro)?

If people agree that this is a good idea, next week I'll post a patch 
for using IN_MULTICAST() instead of the redundant "multicast" tag.

The Long story:
I am streaming some audio and video over RTP with ffmpeg, and trying to 
receive it with ffplay. The SDP describing the streams is
o=- 0 0 IN IPV4
t=0 0
s=No Name
m=video 10000 RTP/AVP 96
c=IN IP4
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=1
m=audio 20000 RTP/AVP 14
c=IN IP4
I believe that this SDP is valid (if I understand the RFC correctly, the 
IP address in the "c=" line is not forced to be a multicast address).

VLC is able to play the stream using the live555 libraries, but ffplay 
and ffmpeg fail with "rtp: IP_ADD_MEMBERSHIP: Invalid argument", because 
they try to open the "udp://" URI.

The error is at line 1371 of libavformat/rtsp.c (sdp_read_header() - 
I'll send a patch for it next week), but I still believe that udp_open() 
is doing a silly thing in using the "multicast" tag...
Am I missing something?


More information about the ffmpeg-devel mailing list