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



##########
File path: 
openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/KStream.java
##########
@@ -162,15 +162,30 @@ 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:
+        *  - If mediaType is anything other then MediaType.AUDIO
+        *  - If type Audio stop in case it has no Video attached
+        *
+        * @param mediaType the MediaType that stopped flowing
+        * @return true in case this stream should be dropped
+        */
+       protected boolean checkFlowOutEventForStopping(MediaType mediaType) {
+               return MediaType.AUDIO != mediaType || !hasVideo;

Review comment:
       If you find this condition hard to read you can rewrite the method as 
   ```
   protected boolean checkFlowOutEventForRunning(MediaType mediaType) {
                return MediaType.AUDIO == mediaType && hasVideo;
   }
   ```
   
   and add negation while using:
   `if (MediaFlowState.NOT_FLOWING == evt.getState() && 
!checkFlowOutEventForRunning(evt.getMediaType()))`
   
   is it looks better?




----------------------------------------------------------------
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