audioringbuffer: avoid division by 0 when outputting debug info
authorMarc Leeman <marc.leeman@gmail.com>
Thu, 14 Mar 2013 09:58:11 +0000 (10:58 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 15 Mar 2013 09:06:07 +0000 (09:06 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=695832

gst-libs/gst/audio/gstaudioringbuffer.c

index 8f7e598..c34bf58 100644 (file)
@@ -178,9 +178,10 @@ gst_audio_ring_buffer_debug_spec_buff (GstAudioRingBufferSpec * spec)
   GST_DEBUG ("acquire ringbuffer: total segments: %d", spec->segtotal);
   GST_DEBUG ("acquire ringbuffer: latency segments: %d", spec->seglatency);
   GST_DEBUG ("acquire ringbuffer: segment size: %d bytes = %d samples",
-      spec->segsize, spec->segsize / bpf);
+      spec->segsize, (bpf != 0) ? (spec->segsize / bpf) : -1);
   GST_DEBUG ("acquire ringbuffer: buffer size: %d bytes = %d samples",
-      spec->segsize * spec->segtotal, spec->segsize * spec->segtotal / bpf);
+      spec->segsize * spec->segtotal,
+      (bpf != 0) ? (spec->segsize * spec->segtotal / bpf) : -1);
 }
 
 /**