From fefcf29fb175d24cb36e76c1bad995c870aa3d78 Mon Sep 17 00:00:00 2001 From: Faisal Hameed Date: Fri, 18 Mar 2016 01:02:23 +0500 Subject: [PATCH] Fixing squid:S1155, squid:S1126 --- src/net/majorkernelpanic/streaming/Session.java | 5 +---- src/net/majorkernelpanic/streaming/hw/EncoderDebugger.java | 5 +---- src/net/majorkernelpanic/streaming/rtsp/RtspServer.java | 6 +++--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/net/majorkernelpanic/streaming/Session.java b/src/net/majorkernelpanic/streaming/Session.java index a904fd4f..45ff8ca1 100644 --- a/src/net/majorkernelpanic/streaming/Session.java +++ b/src/net/majorkernelpanic/streaming/Session.java @@ -354,10 +354,7 @@ public long getBitrate() { /** Indicates if a track is currently running. */ public boolean isStreaming() { - if ( (mAudioStream!=null && mAudioStream.isStreaming()) || (mVideoStream!=null && mVideoStream.isStreaming()) ) - return true; - else - return false; + return (mAudioStream!=null && mAudioStream.isStreaming()) || (mVideoStream!=null && mVideoStream.isStreaming()); } /** diff --git a/src/net/majorkernelpanic/streaming/hw/EncoderDebugger.java b/src/net/majorkernelpanic/streaming/hw/EncoderDebugger.java index 981027cf..f5e165ea 100644 --- a/src/net/majorkernelpanic/streaming/hw/EncoderDebugger.java +++ b/src/net/majorkernelpanic/streaming/hw/EncoderDebugger.java @@ -807,10 +807,7 @@ private long decode(boolean withPrefix) { * @param withPrefix If set to true, the NAL will be preceded with 0x00000001. */ private boolean hasPrefix(byte[] nal) { - if (nal[0] == 0 && nal[1] == 0 && nal[2] == 0 && nal[3] == 0x01) - return true; - else - return false; + return nal[0] == 0 && nal[1] == 0 && nal[2] == 0 && nal[3] == 0x01; } /** diff --git a/src/net/majorkernelpanic/streaming/rtsp/RtspServer.java b/src/net/majorkernelpanic/streaming/rtsp/RtspServer.java index 8d0dab10..bfb76506 100644 --- a/src/net/majorkernelpanic/streaming/rtsp/RtspServer.java +++ b/src/net/majorkernelpanic/streaming/rtsp/RtspServer.java @@ -121,7 +121,7 @@ public interface CallbackListener { */ public void addCallbackListener(CallbackListener listener) { synchronized (mListeners) { - if (mListeners.size() > 0) { + if (!mListeners.isEmpty()) { for (CallbackListener cl : mListeners) { if (cl == listener) return; } @@ -285,7 +285,7 @@ public IBinder onBind(Intent intent) { protected void postMessage(int id) { synchronized (mListeners) { - if (mListeners.size() > 0) { + if (!mListeners.isEmpty()) { for (CallbackListener cl : mListeners) { cl.onMessage(this, id); } @@ -295,7 +295,7 @@ protected void postMessage(int id) { protected void postError(Exception exception, int id) { synchronized (mListeners) { - if (mListeners.size() > 0) { + if (!mListeners.isEmpty()) { for (CallbackListener cl : mListeners) { cl.onError(this, exception, id); }