Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use h264_stap_decode_annexb() #1151

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 6 additions & 23 deletions test/h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,29 +635,12 @@ static int depack_handle_h264(struct state *st, bool marker,
}
else if (H264_NALU_STAP_A == h264_hdr.type) {

while (mbuf_get_left(src) >= 2) {

uint16_t len = ntohs(mbuf_read_u16(src));
struct h264_nal_header lhdr;

if (mbuf_get_left(src) < len)
return EBADMSG;

err = h264_nal_header_decode(&lhdr, src);
if (err)
return err;

--src->pos;

err = mbuf_write_mem(st->mb,
st->long_startcode ? nal_seq4 : nal_seq3,
nal_seq_len);
err |= mbuf_write_mem(st->mb, mbuf_buf(src), len);
if (err)
goto out;

src->pos += len;
}
if (st->long_startcode)
err = h264_stap_decode_annexb_long(st->mb, src);
else
err = h264_stap_decode_annexb(st->mb, src);
if (err)
goto out;
}
else {
DEBUG_WARNING("decode: unknown NAL type %u\n",
Expand Down
Loading