diff --git a/ext/avtp/gstavtpcvfpay.c b/ext/avtp/gstavtpcvfpay.c index 80c61a22a8..dcbdd9d252 100644 --- a/ext/avtp/gstavtpcvfpay.c +++ b/ext/avtp/gstavtpcvfpay.c @@ -483,22 +483,24 @@ gst_avtp_cvf_pay_prepare_avtp_packets (GstAvtpCvfPay * avtpcvfpay, return TRUE; } -static gboolean +static GstFlowReturn gst_avtp_cvf_pay_push_packets (GstAvtpCvfPay * avtpcvfpay, GPtrArray * avtp_packets) { int i; + GstFlowReturn ret; GstAvtpBasePayload *avtpbasepayload = GST_AVTP_BASE_PAYLOAD (avtpcvfpay); for (i = 0; i < avtp_packets->len; i++) { GstBuffer *packet; packet = g_ptr_array_index (avtp_packets, i); - if (gst_pad_push (avtpbasepayload->srcpad, packet) != GST_FLOW_OK) - return FALSE; + ret = gst_pad_push (avtpbasepayload->srcpad, packet); + if (ret != GST_FLOW_OK) + return ret; } - return TRUE; + return GST_FLOW_OK; } static GstFlowReturn @@ -523,8 +525,7 @@ gst_avtp_cvf_pay_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) avtp_packets = g_ptr_array_new (); gst_avtp_cvf_pay_prepare_avtp_packets (avtpcvfpay, nals, avtp_packets); - if (!gst_avtp_cvf_pay_push_packets (avtpcvfpay, avtp_packets)) - ret = GST_FLOW_ERROR; + ret = gst_avtp_cvf_pay_push_packets (avtpcvfpay, avtp_packets); /* Contents of both ptr_arrays should be unref'd or transferred * to rightful owner by this point, no need to unref them again */ diff --git a/tests/check/elements/avtpcvfpay.c b/tests/check/elements/avtpcvfpay.c index f3f3c2a354..66f8d3898c 100644 --- a/tests/check/elements/avtpcvfpay.c +++ b/tests/check/elements/avtpcvfpay.c @@ -137,6 +137,29 @@ compare_h264_avtpdu (struct avtp_stream_pdu *pdu, GstBuffer * buffer) return result; } +GST_START_TEST (test_payloader_downstream_eos) +{ + GstHarness *h; + GstBuffer *in; + + /* Create the harness for the avtpcvfpay */ + h = gst_harness_new_parse + ("avtpcvfpay streamid=0xAABBCCDDEEFF0001 mtt=1000000 tu=1000000 processing-deadline=0 ! fakesink num-buffers=1"); + gst_harness_set_src_caps (h, generate_caps (4)); + + /* Buffer must have the nal len (4 bytes) and the nal (4 bytes) */ + in = gst_harness_create_buffer (h, 8); + add_nal (in, 4, 1, 0); + GST_BUFFER_DTS (in) = 1000000; + GST_BUFFER_PTS (in) = 2000000; + + fail_unless_equals_int (gst_harness_push (h, in), GST_FLOW_EOS); + + gst_harness_teardown (h); +} + +GST_END_TEST; + GST_START_TEST (test_payloader_zero_sized_nal) { GstHarness *h; @@ -674,6 +697,7 @@ avtpcvfpay_suite (void) tcase_add_test (tc_chain, test_payloader_properties); tcase_add_test (tc_chain, test_payloader_no_codec_data); tcase_add_test (tc_chain, test_payloader_zero_sized_nal); + tcase_add_test (tc_chain, test_payloader_downstream_eos); return s; }