[Live-devel] possible candidate for patch (Groupsock.cpp)

Maxim Petrov max at code-it-now.com
Thu Mar 29 03:25:02 PDT 2007


Hi Ross.

I noticed strange performance troubles on server side (CPU usage was 
more than usually) when streaming huge JPEG files. After few minutes of 
researching I noticed that for sending each RTP packet we call 
"outputToAllMemberExcept" function even if we don't have any member. So 
basicaly it's useless? Here's patch:

@@ -269,11 +269,14 @@
     statsGroupOutgoing.countPacket(bufferSize);

     // Then, forward to our members:
-    int numMembers =
-      outputToAllMembersExcept(interfaceNotToFwdBackTo,
+    int numMembers = 0;
+    if (!members().IsEmpty()) {
+        numMembers =
+          outputToAllMembersExcept(interfaceNotToFwdBackTo,
                               ttlToSend, buffer, bufferSize,
                               ourSourceAddressForMulticast(env));
     if (numMembers < 0) break;
+    }

     if (DebugLevel >= 3) {
       env << *this << ": wrote " << bufferSize << " bytes, ttl "


After applying this patch CPU usage normalized again. Can you please 
comment is patch correct or no?




More information about the live-devel mailing list