summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Leeman <marc.leeman@gmail.com>2013-03-14 10:58:11 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2013-03-15 09:06:07 +0000
commit0fa50b44f075fa0a11fb9db4656ff6cae7f104a2 (patch)
tree34596117e7635949d1c8333777e02992d38de72d
parentd99e270fc83278c309ec7cad20d75181d90b8722 (diff)
audioringbuffer: avoid division by 0 when outputting debug info
https://bugzilla.gnome.org/show_bug.cgi?id=695832
-rw-r--r--gst-libs/gst/audio/gstaudioringbuffer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gst-libs/gst/audio/gstaudioringbuffer.c b/gst-libs/gst/audio/gstaudioringbuffer.c
index 8f7e5980a..c34bf58a7 100644
--- a/gst-libs/gst/audio/gstaudioringbuffer.c
+++ b/gst-libs/gst/audio/gstaudioringbuffer.c
@@ -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);
}
/**