interaudiosink: Use the bpf from the audio info instead of hardcoding 4
authorSebastian Dröge <sebastian@centricular.com>
Tue, 4 Nov 2014 12:59:20 +0000 (13:59 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 4 Nov 2014 12:59:20 +0000 (13:59 +0100)
gst/inter/gstinteraudiosink.c

index ccc69fc7dbc5615ee682b8d984f75c6ea2fa9e31..6794e498b8ca99bd2ea25dbfdfa6aaad9e912839 100644 (file)
@@ -256,7 +256,7 @@ gst_inter_audio_sink_render (GstBaseSink * sink, GstBuffer * buffer)
   bpf = interaudiosink->info.bpf;
 
   g_mutex_lock (&interaudiosink->surface->mutex);
-  n = gst_adapter_available (interaudiosink->surface->audio_adapter) / 4;
+  n = gst_adapter_available (interaudiosink->surface->audio_adapter) / bpf;
   while (n > PERIOD * N_PERIODS) {
     GST_WARNING_OBJECT (interaudiosink, "flushing %d samples", PERIOD / 2);
     gst_adapter_flush (interaudiosink->surface->audio_adapter,