Skip to content

Commit

Permalink
test: add pktsize to test_h264_packet_base()
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh committed Oct 24, 2024
1 parent baee91a commit fd98796
Showing 1 changed file with 6 additions and 5 deletions.
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

0 comments on commit fd98796

Please sign in to comment.