Skip to content

Commit

Permalink
Merge pull request fyhertz#189 from DevFactory/release/general-code-q…
Browse files Browse the repository at this point in the history
…uality-fix-1

General code quality fix-1
  • Loading branch information
Simon authored Mar 13, 2017
2 parents 197b569 + fefcf29 commit 3a7a52f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
5 changes: 1 addition & 4 deletions src/net/majorkernelpanic/streaming/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/net/majorkernelpanic/streaming/hw/EncoderDebugger.java
Original file line number Diff line number Diff line change
Expand Up @@ -805,10 +805,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;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/net/majorkernelpanic/streaming/rtsp/RtspServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 3a7a52f

Please sign in to comment.