I modified the live555 source code where sendto function locate.
I add a multicast after sendto function.
int bytesSent = sendto(socket, (char*)buffer, bufferSize, 0, (struct sockaddr*)&dest, sizeof dest);
//zhouhua add below
if(zhou_init == 0){
zhou_init = 1;
memset(&mcast_addr,0,sizeof(mcast_addr));
mcast_addr.sin_family = AF_INET;
mcast_addr.sin_addr.s_addr = inet_addr("224.0.0.251");
mcast_addr.sin_port = htons(5004);
}
int k = sendto(socket, (char*)buffer, bufferSize,0,(struct sockaddr*)&mcast_addr, sizeof(mcast_addr));
printf("k = %d\n", k);
//zhou end
It works when I play the rtsp stream. When I play a sdp file, it plays the multicast video.
But, on win7, I can't get any response with vlc player.
While wireshark get the same multicast data on win7 and ubuntu.
Why it not work on win7 ?