sebawagner commented on a change in pull request #128:
URL: https://github.com/apache/openmeetings/pull/128#discussion_r574784305



##########
File path: 
openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/KStream.java
##########
@@ -162,15 +162,39 @@ public void onError(Throwable cause) throws Exception {
                });
        }
 
+       /**
+        * Invoked in case stream stops to decide on if this stream is worth 
stopping.
+        *
+        * Stop broadcast in case:
+        *  - Audio only stream and audio has been detected as not streaming 
anymore
+        *  - Video or Data
+        *
+        * @param mediaType the MediaType that stopped flowing
+        * @return true in case this stream should be dropped
+        */
+       private boolean checkFlowOutEventForStopping(MediaType mediaType) {
+               if (MediaType.AUDIO == mediaType) {

Review comment:
       I can, I just had to think for almost 15min around if those 3 use-cases:
   
   1. It should return false (not stopBroadCast) in case MediaType.AUDIO == 
mediaType and hasVideo == true
   2. It should return true (do stopBroadCast)in case MediaType.AUDIO == 
mediaType and hasVideo == false
   3. It should return true (do stopBroadCast) in case MediaType.AUDIO != 
mediaType
   
   are correct with this statement. I think this double negation with ||, I 
don't think a lot of people find it easy to translate it actual behaviour.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to