Dear Sir:<br><br>The fourth parameter "forceMulticastOnUnspecified" of RTSPClient::setupMediaSubsession() will guide the client agent to setup a multicast subsession if the IP address is not specified in SDP. The client will then join the multicast group later by calling
subsession.setDestinations(fServerAddress) which then invokes fRTPSocket->changeDestinationParameters(destAddr, destPort, destTTL). However, Groupsock::changeDestinationParameters() doesn't consider if it has a source filter address specified in SDP and just try a regular multicast address group leave and join.
<br><br>Hence, I suggest to modify as follows:<br><br>Groupsock::changeDestinationParameters(...) {<br>...<br>...<br>if (newDestAddr.s_addr != 0) {<br> if (newDestAddr.s_addr != destAddr.s_addr<br> && IsMulticastAddress(
newDestAddr.s_addr)) {<br> // If the new destination is a multicast address, then we assume that<br> // we want to join it also. (If this is not in fact the case, then<br> // call "multicastSendOnly()" afterwards.)
<br><br> if (isSSM()) {<br> if (!socketLeaveGroupSSM(env(), socketNum(), destAddr.s_addr, sourceFilterAddress().s_addr))<br> socketLeaveGroup(env(), socketNum(), destAddr.s_addr);
<br> else<br> socketLeaveGroup(env(), socketNum(), groupAddress().s_addr);<br> <br> if (!socketJoinGroupSSM(env(), socketNum(), newDestAddr.s_addr, sourceFilterAddress().s_addr)) {
<br> if (DebugLevel >= 3) {<br> env() << *this << ": SSM join failed: " << env().getResultMsg();<br> env() << " - trying regular join instead\n";
<br> }<br> if (!socketJoinGroup(env(), socketNum(), newDestAddr.s_addr)) {<br> if (DebugLevel >= 1) <br> env() << *this << ": failed to join group: " << env().getResultMsg() << "\n";
<br> }<br> }<br> } else {<br> socketLeaveGroup(env(), socketNum(), destAddr.s_addr);<br> socketJoinGroup(env(), socketNum(), newDestAddr.s_addr);<br> }<br> }
<br> destAddr.s_addr = newDestAddr.s_addr;<br>}<br>...<br>}<br><br><br>Besides, the ws2tcpip.h provided in a newly installed Visual Studio C++ 6 doesn't define IP_ADD_SOURCE_MEMBERSHIP and IP_DROP_SOURCE_MEMBERSHIP so the following conditional macro in
GroupHelper.cpp wiill define them as wrong values on Windows.<br><br>#ifdef LINUX<br>#define IP_ADD_SOURCE_MEMBERSHIP 39<br>#define IP_DROP_SOURCE_MEMBERSHIP 40<br>#else<br>#define IP_ADD_SOURCE_MEMBERSHIP 25 // should be 15 on Windows
<br>#define IP_DROP_SOURCE_MEMBERSHIP 26 // should be 16 on Windows<br>#endif<br><br>Therefore, I suggest modify the above as the following:<br><br>#ifdef LINUX<br>#define IP_ADD_SOURCE_MEMBERSHIP 39<br>#define IP_DROP_SOURCE_MEMBERSHIP 40
<br>#elif defined(WINNT) || defined(_WINNT)<br>#define IP_ADD_SOURCE_MEMBERSHIP 15 /* join IP group/source */<br>#define IP_DROP_SOURCE_MEMBERSHIP 16 /* leave IP group/source */<br>#define IP_BLOCK_SOURCE 17 /* block IP group/source */
<br>#define IP_UNBLOCK_SOURCE 18 /* unblock IP group/source */<br>#define IP_PKTINFO 19 /* receive packet information for ipv4*/<br>#define IP_RECEIVE_BROADCAST 22 /* allow/block broadcast reception */
<br>#else<br>#define IP_ADD_SOURCE_MEMBERSHIP 25<br>#define IP_DROP_SOURCE_MEMBERSHIP 26<br>#endif<br><br>BR<br>Brain Lai<br> <br>