Skip to content

Commit 733856f

Browse files
committed
rtpulpfec: fix scanbuild
1 parent 7796bdd commit 733856f

File tree

1 file changed

+8
-5
lines changed
  • subprojects/gst-plugins-good/tests/check/elements

1 file changed

+8
-5
lines changed

subprojects/gst-plugins-good/tests/check/elements/rtpulpfec.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ harness_rtpulpfecenc (guint32 ssrc, guint8 lost_pt, gint *percentage)
499499
GST_START_TEST (rtpulpfecdec_repairmeta)
500500
{
501501
guint i = 0;
502-
guint16 block_seq[8];
502+
guint16 block_seq[8] = {0};
503503
guint16 seq = 12511;
504504
const gint block_len = G_N_ELEMENTS (block_seq);
505505
const gfloat redrate = 0.25f;
@@ -524,21 +524,24 @@ GST_START_TEST (rtpulpfecdec_repairmeta)
524524
fail_unless (gst_rtp_buffer_map (bufout,
525525
GST_MAP_READ, &rtp));
526526
fail_unless_equals_int (gst_rtp_buffer_get_seq (&rtp), seq);
527+
const guint8 pt = gst_rtp_buffer_get_payload_type (&rtp);
527528
GstRTPRepairMeta *meta = gst_buffer_get_rtp_repair_meta (bufout);
528-
if (meta) {
529+
if (pt == 100) {
529530
/* Got a redundant packet from FEC encoder, check its repair meta */
531+
fail_unless (meta);
530532
fail_unless_equals_int (meta->ssrc, 0x00000d51);
531533
fail_unless_equals_int (meta->seqnums->len, block_len);
532534
for (gint j = 0; j < block_len; ++j) {
533535
fail_unless_equals_int (g_array_index(meta->seqnums, guint16, j),
534536
block_seq[j]);
535537
}
536-
fail_unless_equals_int (gst_rtp_buffer_get_payload_type (&rtp), 100);
537-
} else {
538-
fail_unless_equals_int (gst_rtp_buffer_get_payload_type (&rtp), 122);
538+
} else if (pt == 122) {
539539
/* Data packet has just poped out, remember its seqnum */
540540
block_seq[i % block_len] = gst_rtp_buffer_get_seq (&rtp);
541+
} else {
542+
fail ("Unexpected payload type");
541543
}
544+
542545
seq++;
543546
gst_rtp_buffer_unmap (&rtp);
544547
} while ((bufout = gst_harness_try_pull (h)) != NULL);

0 commit comments

Comments
 (0)