From 5567066bff82f2d345af18d1adffbb74f0007fc2 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Wed, 6 Mar 2019 19:19:03 +0100 Subject: [PATCH] test: rtpbin_buffer_list: make check_packet more flexible Make it possible to differentiate between the position in the list and the packet index in the global structures in check_packet, in some future case the list may change, in case some element removes a buffer from the list, and the two indices may not coincide. --- tests/check/elements/rtpbin_buffer_list.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/check/elements/rtpbin_buffer_list.c b/tests/check/elements/rtpbin_buffer_list.c index c83d0fd24..d241c6bfc 100644 --- a/tests/check/elements/rtpbin_buffer_list.c +++ b/tests/check/elements/rtpbin_buffer_list.c @@ -210,20 +210,20 @@ check_payload (GstBuffer * buffer, guint index) } static void -check_packet (GstBufferList * list, guint index) +check_packet (GstBufferList * list, guint list_index, guint packet_index) { GstBuffer *buffer; fail_unless (list != NULL); - fail_unless ((buffer = gst_buffer_list_get (list, index)) != NULL); + fail_unless ((buffer = gst_buffer_list_get (list, list_index)) != NULL); fail_unless (gst_buffer_n_memory (buffer) == 2); fail_unless (GST_BUFFER_TIMESTAMP (buffer) == GST_BUFFER_TIMESTAMP (original_buffer)); - check_header (buffer, index); - check_payload (buffer, index); + check_header (buffer, packet_index); + check_payload (buffer, packet_index); } /* @@ -257,10 +257,10 @@ sink_chain_list (GstPad * pad, GstObject * parent, GstBufferList * list) fail_unless (gst_buffer_list_length (list) == 2); fail_unless (gst_buffer_list_get (list, 0)); - check_packet (list, 0); + check_packet (list, 0, 0); fail_unless (gst_buffer_list_get (list, 1)); - check_packet (list, 1); + check_packet (list, 1, 1); gst_buffer_list_unref (list); -- 2.34.1