AW: VLC does _not_ work with multicast, but VLS surely does (Even more info)

Stephan D´Costa stephan.dcosta at tikom.at
Wed Jul 17 10:10:36 CEST 2002


Hi Roy,

VLC (resp. the binary windows version 0.4.1) DOES work with multicast.
Perhaps you have a problem with your windows-installation.

When I tried to receive a multicast stream on my PC for the first time,
it went into trouble, too. I had a "normal" NIC and a WinTV nova inside
my PC, both assigned to the TCP/IP protokoll. Unicast worked fine, but 
multicast didn't. The only way to receive the multicast stream correctly
was to disable the TCP/IP protokoll for the WINTV nova.

Does your client PC also have more than one network adaptor?

Hope this helps
	Stephan


> -----Ursprüngliche Nachricht-----
> Von: vlc-bounce at videolan.org [mailto:vlc-bounce at videolan.org] 
> Im Auftrag von Roy Sigurd Karlsbakk
> Gesendet: Dienstag, 16. Juli 2002 21:30
> An: vlc at videolan.org; vlc-devel at videolan.org
> Betreff: VLC does _not_ work with multicast, but VLS surely 
> does (Even more info)
> 
> 
> > hi all
> >
> > After hours, I've come to the conclusion that VLC doesn't work with 
> > multicast. I've tested playing from localhost, from other computers 
> > and - at last - from a Windows machine connected to a damn hub 
> > together with the server.
> >
> > nothing
> >
> > If I do the same over Unicast, it works fine
> 
> Trying to check for VLS failure...
> 
> The error is _not_ VLS. I wrote a small program (below) to 
> join the given 
> multicast group, reposition to the next TS packet and dump it 
> all from there 
> to STDOUT, and it works fine. Somehow VLC doesn't understand 
> it, but that's 
> probably because it wants some nice start of files.
> 
> So - what the hell is VLC doing wrong?
> 
> roy
> --
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
> #include <arpa/inet.h>
> #include <netdb.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> 
> #define MC_GROUP			"239.1.1.3"
> #define MC_PORT				1234
> #define BUFFERSIZE			(1024 * 32)
> 
> #endif
> 
> int main() {
> 	int s,addrlen,br;
> 	struct sockaddr_in addr;
> 	struct ip_mreq mreq;
> 	char buf[BUFFERSIZE];
> 	int firstblock = 1;
> 	int fbcounter;
> 
> 	s = socket(AF_INET, SOCK_DGRAM, 0);
> 	if (s == -1) {
> 		perror("socket");
> 		exit(1);
> 	}
> 
> 	addr.sin_family=AF_INET;
> 	addr.sin_addr.s_addr=htonl(INADDR_ANY); /* N.B.: 
> differs from sender */
> 	addr.sin_port=htons(MC_PORT);
> 
> 	if (bind(s,(struct sockaddr *) &addr,sizeof(addr)) < 0) {
> 		perror("bind");
> 		exit(1);
> 	}
>     
> 	mreq.imr_multiaddr.s_addr=inet_addr(MC_GROUP);
> 	mreq.imr_interface.s_addr=htonl(INADDR_ANY);
> 
> 	if (setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, 
> sizeof(mreq)) < 0) {
> 		perror("setsockopt");
> 		exit(1);
> 	}
> 
> 	while (1) {
> 		addrlen=sizeof(addr);
> 		if ((br = recvfrom(s, buf, BUFFERSIZE, 0, 
> (struct sockaddr *) &addr, 
> &addrlen)) < 0) {
> 			perror("recvfrom");
> 			exit(1);
> 		}
> 		if (firstblock) {
> 			fbcounter = 0;
> 			while (1) {
> 				while (buf[fbcounter] != 0x47)
> 					fbcounter++;
> 				if (buf[fbcounter+188] == 0x47 && 
> 					buf[fbcounter+376] == 0x47 && 
> 					buf[fbcounter+564] == 0x47 && 
> 					buf[fbcounter+752] == 0x47)
> 					break;
> 				if (fbcounter > 188) {
> 					fprintf(stderr, 
> "unknown stream format\n");
> 					exit(1);
> 				}
> 			}
> 			br-=fbcounter;
> 			write(1, &buf[fbcounter], br);
> 			firstblock++;
> 		} else {
> 			write(1, buf, br);
> 		}
> 	}
> 
> 	return 0;
> }
> 
> 
> -- 
> Roy Sigurd Karlsbakk, Datavaktmester
> 
> Computers are like air conditioners.
> They stop working when you open Windows.
> 
> 
> -- 
> This is the vlc mailing-list, see 
> http://www.videolan.org/vlc/ To unsubscribe, > please read 
> http://www.videolan.org/lists.html
> If you are in trouble, please contact <postmaster at videolan.org>
> 


-- 
This is the vlc mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc mailing list