From efb74ca0df86954d2cbb51109e3bc214d814f874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 15 Jan 2015 13:13:51 +0100 Subject: [PATCH] interaudiosink: Make sure that buffer time is always bigger than period time --- gst/inter/gstinteraudiosink.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst/inter/gstinteraudiosink.c b/gst/inter/gstinteraudiosink.c index d8e34ea77a..58e78325ec 100644 --- a/gst/inter/gstinteraudiosink.c +++ b/gst/inter/gstinteraudiosink.c @@ -300,6 +300,16 @@ gst_inter_audio_sink_render (GstBaseSink * sink, GstBuffer * buffer) buffer_time = interaudiosink->surface->audio_buffer_time; period_time = interaudiosink->surface->audio_period_time; + + if (buffer_time < period_time) { + GST_ERROR_OBJECT (interaudiosink, + "Buffer time smaller than period time (%" GST_TIME_FORMAT " < %" + GST_TIME_FORMAT ")", GST_TIME_ARGS (buffer_time), + GST_TIME_ARGS (period_time)); + g_mutex_unlock (&interaudiosink->surface->mutex); + return GST_FLOW_ERROR; + } + buffer_samples = gst_util_uint64_scale (buffer_time, interaudiosink->info.rate, GST_SECOND);