mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
Check mandatory ClockTime arguments
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1205>
This commit is contained in:
parent
885c1c605b
commit
973f0bf552
5 changed files with 13 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue