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: add pktsize to test_h264_packet_base() #1205

Merged
merged 1 commit into from
Oct 24, 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
11 changes: 6 additions & 5 deletions test/h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,10 @@ static int packet_handler(bool marker, uint64_t rtp_ts,
}


static int test_h264_packet_base(const char *bs, bool long_startcode)
static int test_h264_packet_base(const char *bs, bool long_startcode,
size_t max_pktsize)
{
struct state state;
const size_t MAX_PKTSIZE = 8;
int err;

memset(&state, 0, sizeof(state));
Expand All @@ -717,7 +717,7 @@ static int test_h264_packet_base(const char *bs, bool long_startcode)
if (!state.mb)
return ENOMEM;

err = h264_packetize(DUMMY_TS, state.buf, state.len, MAX_PKTSIZE,
err = h264_packetize(DUMMY_TS, state.buf, state.len, max_pktsize,
packet_handler, &state);
if (err)
goto out;
Expand Down Expand Up @@ -748,12 +748,13 @@ static const char *bitstream_long =

int test_h264_packet(void)
{
const size_t MAX_PKTSIZE = 8;
int err;

err = test_h264_packet_base(bitstream, false);
err = test_h264_packet_base(bitstream, false, MAX_PKTSIZE);
TEST_ERR(err);

err = test_h264_packet_base(bitstream_long, true);
err = test_h264_packet_base(bitstream_long, true, MAX_PKTSIZE);
TEST_ERR(err);

out:
Expand Down
Loading