diff --git a/io/src/main/java/org/red5/codec/AVCVideo.java b/io/src/main/java/org/red5/codec/AVCVideo.java index 4679d4d13..b31db76cf 100644 --- a/io/src/main/java/org/red5/codec/AVCVideo.java +++ b/io/src/main/java/org/red5/codec/AVCVideo.java @@ -68,11 +68,11 @@ public boolean addData(IoBuffer data, int timestamp) { if (enhanced) { // get the packet type packetType = VideoPacketType.valueOf(flg & IoConstants.MASK_VIDEO_CODEC); - if(frameType.getValue() < 5 && packetType.getPacketType() < 5 ) { + if (frameType.getValue() < 5 && packetType.getPacketType() < 5) { // get the fourcc - fourcc = data.getInt(); + fourcc = data.getInt(); result = (codec.getFourcc() == fourcc); - if(!result) { + if (!result) { data.reset(); return result; } @@ -184,9 +184,8 @@ public boolean addData(IoBuffer data, int timestamp) { // not handled break; } - - - } else if((flg & IoConstants.MASK_VIDEO_CODEC) == codec.getId()){ + + } else if ((flg & IoConstants.MASK_VIDEO_CODEC) == codec.getId()) { result = true; // get the codecs frame type byte avcType = data.get(); @@ -196,11 +195,11 @@ public boolean addData(IoBuffer data, int timestamp) { log.debug("AVC type: {}", avcType); } switch (avcType) { - case 1: // VCL video coding layer, + case 1: // VCL video coding layer, frameType = VideoFrameType.valueOf((flg & IoConstants.MASK_VIDEO_FRAMETYPE) >> 4); switch (frameType) { case KEYFRAME: // keyframe - + if (isDebug) { log.debug("Keyframe - keyframeTimestamp: {}", keyframeTimestamp); } @@ -236,7 +235,7 @@ public boolean addData(IoBuffer data, int timestamp) { //log.trace("Interframes: {}", interframes.size()); } break; - } + } break; case 0: // configuration if (isDebug) { diff --git a/io/src/main/java/org/red5/codec/AbstractVideo.java b/io/src/main/java/org/red5/codec/AbstractVideo.java index 57dd2242b..e8daa21ca 100644 --- a/io/src/main/java/org/red5/codec/AbstractVideo.java +++ b/io/src/main/java/org/red5/codec/AbstractVideo.java @@ -186,8 +186,8 @@ public boolean addData(IoBuffer data, int timestamp) { if (multitrackType != AvMultitrackType.ManyTracksManyCodecs) { // The tracks are encoded with the same codec identified by the FOURCC trackCodec = getTrackCodec(data); - } - }else { + } + } else { trackCodec = getTrackCodec(data); } log.debug("Multitrack: {} multitrackType: {} packetType: {}", multitrack, multitrackType, packetType); @@ -248,10 +248,10 @@ public boolean addData(IoBuffer data, int timestamp) { // break out of the loop break; } - if(command != null && trackCodec == null) { + if (command != null && trackCodec == null) { result = true; - }else { - result = multitrack?true:codec == trackCodec.getCodec(); + } else { + result = multitrack ? true : codec == trackCodec.getCodec(); } } else { // read the first byte verify the codec matches