diff --git a/subprojects/gst-plugins-bad/gst/codectimestamper/gstcodectimestamper.c b/subprojects/gst-plugins-bad/gst/codectimestamper/gstcodectimestamper.c index 5c93f8d564..ea75561860 100644 --- a/subprojects/gst-plugins-bad/gst/codectimestamper/gstcodectimestamper.c +++ b/subprojects/gst-plugins-bad/gst/codectimestamper/gstcodectimestamper.c @@ -506,7 +506,12 @@ gst_codec_timestamper_drain (GstCodecTimestamper * self) static gint pts_compare_func (const GstClockTime * a, const GstClockTime * b) { - return (*a) - (*b); + if (*a < *b) + return -1; + else if (*a > *b) + return 1; + else + return 0; } static GstFlowReturn diff --git a/subprojects/gst-plugins-bad/tests/check/elements/h264timestamper.c b/subprojects/gst-plugins-bad/tests/check/elements/h264timestamper.c index b7206bae6b..df69e525b3 100644 --- a/subprojects/gst-plugins-bad/tests/check/elements/h264timestamper.c +++ b/subprojects/gst-plugins-bad/tests/check/elements/h264timestamper.c @@ -128,6 +128,9 @@ GST_START_TEST (test_input_pts_none) GST_BUFFER_PTS (buffer) = 0; fail_unless_equals_int (gst_harness_push (h, buffer), GST_FLOW_OK);; buffer = gst_buffer_new_memdup (h264_idrframe, G_N_ELEMENTS (h264_idrframe)); + GST_BUFFER_PTS (buffer) = 3 * GST_SECOND; + fail_unless_equals_int (gst_harness_push (h, buffer), GST_FLOW_OK);; + buffer = gst_buffer_new_memdup (h264_idrframe, G_N_ELEMENTS (h264_idrframe)); GST_BUFFER_PTS (buffer) = GST_CLOCK_TIME_NONE; fail_unless_equals_int (gst_harness_push (h, buffer), GST_FLOW_OK);; buffer = gst_buffer_new_memdup (h264_idrframe, G_N_ELEMENTS (h264_idrframe));