Skip to content
Snippets Groups Projects
Commit b7a613fb authored by Leo Ma's avatar Leo Ma
Browse files

Improve code quality


Signed-off-by: default avatarLeo Ma <begeekmyfriend@gmail.com>
parent 4844254b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -663,7 +663,6 @@ public class SrsFlvMuxer {
tbb.data = bb.slice();
tbb.size = bi.size - bb.position();
}
return tbb;
}
}
Loading
Loading
@@ -854,15 +853,10 @@ public class SrsFlvMuxer {
int dts = pts;
int type = SrsCodecVideoAVCFrame.InterFrame;
SrsFlvFrameBytes frame = avc.demuxAnnexb(bb, bi, true);
int nal_unit_type = (int)(frame.data.get(0) & 0x1f);
if (nal_unit_type == SrsAvcNaluType.NonIDR)
{
} else if (nal_unit_type == SrsAvcNaluType.IDR)
{
int nal_unit_type = frame.data.get(0) & 0x1f;
if (nal_unit_type == SrsAvcNaluType.IDR) {
type = SrsCodecVideoAVCFrame.KeyFrame;
} else if (nal_unit_type == SrsAvcNaluType.SPS || nal_unit_type == SrsAvcNaluType.PPS)
{
} else if (nal_unit_type == SrsAvcNaluType.SPS || nal_unit_type == SrsAvcNaluType.PPS) {
if (!frame.data.equals(h264_sps)) {
byte[] sps = new byte[frame.size];
frame.data.get(sps);
Loading
Loading
@@ -879,8 +873,9 @@ public class SrsFlvMuxer {
writeH264SpsPps(dts, pts);
}
return;
} else
} else if (nal_unit_type != SrsAvcNaluType.NonIDR) {
return;
}
 
ipbs.add(avc.muxNaluHeader(frame));
ipbs.add(frame);
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment