audioringbuffer: avoid division by 0 when outputting debug info

https://bugzilla.gnome.org/show_bug.cgi?id=695832
This commit is contained in:
Marc Leeman 2013-03-14 10:58:11 +01:00 committed by Tim-Philipp Müller
parent d99e270fc8
commit 0fa50b44f0

View 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: total segments: %d", spec->segtotal);
GST_DEBUG ("acquire ringbuffer: latency segments: %d", spec->seglatency); GST_DEBUG ("acquire ringbuffer: latency segments: %d", spec->seglatency);
GST_DEBUG ("acquire ringbuffer: segment size: %d bytes = %d samples", 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", 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);
} }
/** /**