audiobasesrc: Round down segsize to an integer number of samples
authorwangzq <qiang_jsj@live.cn>
Thu, 28 Jun 2018 12:13:04 +0000 (20:13 +0800)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 29 Jun 2018 05:38:20 +0000 (07:38 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=796704

gst-libs/gst/audio/gstaudiobasesrc.c

index 8847d75..9aaf75f 100644 (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);