Skip to content

Commit

Permalink
Fixes failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornvolcker committed Dec 19, 2024
1 parent 1918258 commit c030b75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/src/signed_video_h26x_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,17 +714,17 @@ signed_video_get_sei(signed_video_t *self,
// Transfer the memory.
*sei = self->sei_data_buffer[0].sei;

// Reset the fetched SEI information from the sei buffer.
--(self->num_of_completed_seis);
shift_sei_buffer_at_index(self, 0);

// Get the offset to the start of the SEI payload if requested.
if (payload_offset) {
h26x_nalu_t nalu_info = parse_nalu_info(*sei, *sei_size, self->codec, false, false);
free(nalu_info.nalu_data_wo_epb);
*payload_offset = (unsigned)(nalu_info.payload - *sei);
}

// Reset the fetched SEI information from the sei buffer.
--(self->num_of_completed_seis);
shift_sei_buffer_at_index(self, 0);

// Update |num_pending_seis| in case SEIs were fetched.
if (num_pending_seis) {
*num_pending_seis = self->sei_data_buffer_idx;
Expand Down
4 changes: 2 additions & 2 deletions tests/check/check_signed_video_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,14 +682,14 @@ START_TEST(two_completed_seis_pending)
sv_rc = signed_video_get_sei(
sv, &sei, &sei_size_1, NULL, p_nalu->data, p_nalu->data_size, &num_pending_seis);
ck_assert_int_eq(sv_rc, SV_OK);
ck_assert_int_eq(num_pending_seis, 2);
ck_assert_int_eq(num_pending_seis, 1);
ck_assert(sei_size_1 != 0);
ck_assert(sei);
free(sei);
// From now on skipping peeks. Now get the second one.
sv_rc = signed_video_get_sei(sv, &sei, &sei_size_2, NULL, NULL, 0, &num_pending_seis);
ck_assert_int_eq(sv_rc, SV_OK);
ck_assert_int_eq(num_pending_seis, 1);
ck_assert_int_eq(num_pending_seis, 0);
ck_assert(sei_size_2 != 0);
ck_assert(sei);
free(sei);
Expand Down

0 comments on commit c030b75

Please sign in to comment.