diff options
author | wangzq <qiang_jsj@live.cn> | 2018-06-28 20:13:04 +0800 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2018-07-18 14:29:55 +0100 |
commit | d6271b4dab9b503c4b3273b97877512e81b93f89 (patch) | |
tree | 686baa0bd6cc472566a665aeca55a66653a84c0c | |
parent | b0876438b70f20467af85f61680b33dbe45e4ba2 (diff) |
audiobasesrc: Round down segsize to an integer number of samples
https://bugzilla.gnome.org/show_bug.cgi?id=796704
-rw-r--r-- | gst-libs/gst/audio/gstaudiobasesrc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gst-libs/gst/audio/gstaudiobasesrc.c b/gst-libs/gst/audio/gstaudiobasesrc.c index e8063eb976..7761e51866 100644 --- a/gst-libs/gst/audio/gstaudiobasesrc.c +++ b/gst-libs/gst/audio/gstaudiobasesrc.c @@ -540,6 +540,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); |