summaryrefslogtreecommitdiff
path: root/sys/tinyalsa
diff options
context:
space:
mode:
authorArun Raghavan <arun@centricular.com>2016-02-05 21:33:38 +0530
committerArun Raghavan <git@arunraghavan.net>2016-02-05 21:35:15 +0530
commit94f1748b6b252fca99fb1efab5b4341c7dc57905 (patch)
treeb2b819c85a9be6b9495a4d168ee5900bc783623a /sys/tinyalsa
parent463ea1a9c7c57ed5fb10a934c32551fed44a29de (diff)
downloadgstreamer-plugins-bad-94f1748b6b252fca99fb1efab5b4341c7dc57905.tar.gz
tinyalsasink: Use glib CLAMP() instead of our own macro
Diffstat (limited to 'sys/tinyalsa')
-rw-r--r--sys/tinyalsa/tinyalsasink.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/tinyalsa/tinyalsasink.c b/sys/tinyalsa/tinyalsasink.c
index f5ebb7662..c29755ebc 100644
--- a/sys/tinyalsa/tinyalsasink.c
+++ b/sys/tinyalsa/tinyalsasink.c
@@ -277,12 +277,6 @@ pcm_config_from_spec (struct pcm_config *config,
config->period_count = spec->buffer_time / spec->latency_time;
}
-#define LIMIT(i, min, max) \
- if ((i) < (min)) \
- (i) = (min); \
- else if ((i) > (max)) \
- (i) = (max);
-
static gboolean
gst_tinyalsa_sink_prepare (GstAudioSink * asink, GstAudioRingBufferSpec * spec)
{
@@ -309,8 +303,9 @@ gst_tinyalsa_sink_prepare (GstAudioSink * asink, GstAudioRingBufferSpec * spec)
pcm_params_free (params);
/* Snap period size/count to the permitted range */
- LIMIT (config.period_size, period_size_min, period_size_max);
- LIMIT (config.period_count, periods_min, periods_max);
+ config.period_size =
+ CLAMP (config.period_size, period_size_min, period_size_max);
+ config.period_count = CLAMP (config.period_count, periods_min, periods_max);
/* mutex with getcaps */
GST_OBJECT_LOCK (sink);