diff options
author | François Laignel <fengalin@free.fr> | 2021-06-16 12:13:21 +0200 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-06-16 14:52:38 +0000 |
commit | 973f0bf55212d5df14943fa230b2427a99e65444 (patch) | |
tree | 9dbe95eda52e22137731d864b732e5252a4c056b | |
parent | 885c1c605bd0050875a822729dfdbeae5a9a5e96 (diff) | |
download | gstreamer-plugins-base-973f0bf55212d5df14943fa230b2427a99e65444.tar.gz |
Check mandatory ClockTime arguments
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1205>
-rw-r--r-- | gst-libs/gst/audio/gstaudiobasesink.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/audio/gstaudiodecoder.c | 2 | ||||
-rw-r--r-- | gst-libs/gst/audio/gstaudioencoder.c | 1 | ||||
-rw-r--r-- | gst-libs/gst/audio/gstaudiostreamalign.c | 4 | ||||
-rw-r--r-- | gst-libs/gst/pbutils/gstdiscoverer.c | 4 |
5 files changed, 13 insertions, 0 deletions
diff --git a/gst-libs/gst/audio/gstaudiobasesink.c b/gst-libs/gst/audio/gstaudiobasesink.c index 359b1b011..8dba7b964 100644 --- a/gst-libs/gst/audio/gstaudiobasesink.c +++ b/gst-libs/gst/audio/gstaudiobasesink.c @@ -685,6 +685,7 @@ gst_audio_base_sink_set_alignment_threshold (GstAudioBaseSink * sink, GstClockTime alignment_threshold) { g_return_if_fail (GST_IS_AUDIO_BASE_SINK (sink)); + g_return_if_fail (GST_CLOCK_TIME_IS_VALID (alignment_threshold)); GST_OBJECT_LOCK (sink); sink->priv->alignment_threshold = alignment_threshold; @@ -725,6 +726,7 @@ gst_audio_base_sink_set_discont_wait (GstAudioBaseSink * sink, GstClockTime discont_wait) { g_return_if_fail (GST_IS_AUDIO_BASE_SINK (sink)); + g_return_if_fail (GST_CLOCK_TIME_IS_VALID (discont_wait)); GST_OBJECT_LOCK (sink); sink->priv->discont_wait = discont_wait; diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index 96184aefa..ec15d6c53 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -3533,6 +3533,7 @@ void gst_audio_decoder_set_min_latency (GstAudioDecoder * dec, GstClockTime num) { g_return_if_fail (GST_IS_AUDIO_DECODER (dec)); + g_return_if_fail (GST_CLOCK_TIME_IS_VALID (num)); GST_OBJECT_LOCK (dec); dec->priv->latency = num; @@ -3576,6 +3577,7 @@ void gst_audio_decoder_set_tolerance (GstAudioDecoder * dec, GstClockTime tolerance) { g_return_if_fail (GST_IS_AUDIO_DECODER (dec)); + g_return_if_fail (GST_CLOCK_TIME_IS_VALID (tolerance)); GST_OBJECT_LOCK (dec); dec->priv->tolerance = tolerance; diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index 4a14d0c48..60cc6af70 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -2544,6 +2544,7 @@ void gst_audio_encoder_set_tolerance (GstAudioEncoder * enc, GstClockTime tolerance) { g_return_if_fail (GST_IS_AUDIO_ENCODER (enc)); + g_return_if_fail (GST_CLOCK_TIME_IS_VALID (tolerance)); GST_OBJECT_LOCK (enc); enc->priv->tolerance = tolerance; diff --git a/gst-libs/gst/audio/gstaudiostreamalign.c b/gst-libs/gst/audio/gstaudiostreamalign.c index ec4233d4e..caabc842e 100644 --- a/gst-libs/gst/audio/gstaudiostreamalign.c +++ b/gst-libs/gst/audio/gstaudiostreamalign.c @@ -86,6 +86,8 @@ gst_audio_stream_align_new (gint rate, GstClockTime alignment_threshold, GstAudioStreamAlign *align; g_return_val_if_fail (rate != 0, NULL); + g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (alignment_threshold), NULL); + g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (discont_wait), NULL); align = g_new0 (GstAudioStreamAlign, 1); align->rate = rate; @@ -193,6 +195,7 @@ gst_audio_stream_align_set_alignment_threshold (GstAudioStreamAlign * align, GstClockTime alignment_threshold) { g_return_if_fail (align != NULL); + g_return_if_fail (GST_CLOCK_TIME_IS_VALID (alignment_threshold)); align->alignment_threshold = alignment_threshold; } @@ -230,6 +233,7 @@ gst_audio_stream_align_set_discont_wait (GstAudioStreamAlign * align, GstClockTime discont_wait) { g_return_if_fail (align != NULL); + g_return_if_fail (GST_CLOCK_TIME_IS_VALID (discont_wait)); align->discont_wait = discont_wait; } diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c index 60e54127b..6d175316c 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/gst-libs/gst/pbutils/gstdiscoverer.c @@ -521,6 +521,8 @@ gst_discoverer_get_property (GObject * object, guint prop_id, static void gst_discoverer_set_timeout (GstDiscoverer * dc, GstClockTime timeout) { + g_return_if_fail (GST_CLOCK_TIME_IS_VALID (timeout)); + GST_DEBUG_OBJECT (dc, "timeout : %" GST_TIME_FORMAT, GST_TIME_ARGS (timeout)); /* FIXME : update current pending timeout if we're running */ @@ -2631,6 +2633,8 @@ gst_discoverer_new (GstClockTime timeout, GError ** err) { GstDiscoverer *res; + g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timeout), NULL); + res = g_object_new (GST_TYPE_DISCOVERER, "timeout", timeout, NULL); if (res->priv->uridecodebin == NULL) { if (err) |