audiobasesrc: Round down segsize to an integer number of samples

https://bugzilla.gnome.org/show_bug.cgi?id=796704
This commit is contained in:
wangzq 2018-06-28 20:13:04 +08:00 committed by Sebastian Dröge
parent d4f607ef40
commit 9f51607723

View file

@ -536,6 +536,8 @@ gst_audio_base_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
/* calculate suggested segsize and segtotal */
spec->segsize = rate * bpf * spec->latency_time / GST_MSECOND;
/* Round to an integer number of samples */
spec->segsize -= spec->segsize % bpf;
spec->segtotal = spec->buffer_time / spec->latency_time;
GST_OBJECT_UNLOCK (src);