summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2021-07-02 13:10:25 +1000
committerSebastian Dröge <sebastian@centricular.com>2021-07-02 10:22:31 +0300
commit8fd2c68968ae922bcf52c628575afc212da35d3e (patch)
treebe4eda8f9fe5c5beb54400a06ab75ad58083cacf /tests
parent5d96e9e7bd28e3fe1d08e0f013aa778961c30209 (diff)
downloadgstreamer-plugins-bad-8fd2c68968ae922bcf52c628575afc212da35d3e.tar.gz
ccconverter: fix framerate caps negotiation from non-cdp to cdp
We can only convert from non-cdp to cdp within the confines of valid cdp framerates. The existing caps negotiation code was allowing any framerate to convert to a cdp output which is incorrect and would hit an assertion later. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2372>
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/ccconverter.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/check/elements/ccconverter.c b/tests/check/elements/ccconverter.c
index 556e26d9d..2b0f6b19f 100644
--- a/tests/check/elements/ccconverter.c
+++ b/tests/check/elements/ccconverter.c
@@ -34,7 +34,7 @@ enum CheckConversionFlags
FLAG_SEND_EOS = 1,
};
-GST_START_TEST (cdp_requires_framerate)
+GST_START_TEST (cdp_requires_valid_framerate)
{
GstHarness *h;
GstBuffer *buffer;
@@ -74,7 +74,17 @@ GST_START_TEST (cdp_requires_framerate)
gst_harness_set_src_caps_str (h,
"closedcaption/x-cea-708,format=(string)cc_data,framerate=(fraction)30/1");
- fail_unless_equals_int (gst_harness_push (h, buffer), GST_FLOW_OK);
+ fail_unless_equals_int (gst_harness_push (h, gst_buffer_ref (buffer)),
+ GST_FLOW_OK);
+
+ /* Then try with an invalid CDP framerate, this should fail */
+ gst_harness_set_sink_caps_str (h,
+ "closedcaption/x-cea-708,format=(string)cdp");
+ gst_harness_set_src_caps_str (h,
+ "closedcaption/x-cea-708,format=(string)cc_data,framerate=(fraction)29/1");
+
+ fail_unless_equals_int (gst_harness_push (h, buffer),
+ GST_FLOW_NOT_NEGOTIATED);
gst_harness_teardown (h);
}
@@ -960,7 +970,7 @@ ccextractor_suite (void)
suite_add_tcase (s, tc);
- tcase_add_test (tc, cdp_requires_framerate);
+ tcase_add_test (tc, cdp_requires_valid_framerate);
tcase_add_test (tc, framerate_passthrough);
tcase_add_test (tc, framerate_changes);
tcase_add_test (tc, framerate_invalid_format);