diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2017-07-13 19:09:43 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2017-10-21 12:06:08 +0200 |
commit | fd81f27bd8e5e5b3e37ad4811597748eaedb7bc2 (patch) | |
tree | 942e7d78192fb984d398e15cd8eef472e2ee1742 /gst-libs | |
parent | 25ea37e7d9b54bb47218b1f7d7c51c4f56d25171 (diff) | |
download | gstreamer-plugins-bad-fd81f27bd8e5e5b3e37ad4811597748eaedb7bc2.tar.gz |
audioaggregator: Accept buffer with no data, but duration and gap flag
These are produced from GAP events by the base class.
https://bugzilla.gnome.org/show_bug.cgi?id=784846
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/audio/gstaudioaggregator.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gst-libs/gst/audio/gstaudioaggregator.c b/gst-libs/gst/audio/gstaudioaggregator.c index 24b71b78d..8e0d48544 100644 --- a/gst-libs/gst/audio/gstaudioaggregator.c +++ b/gst-libs/gst/audio/gstaudioaggregator.c @@ -791,6 +791,18 @@ gst_audio_aggregator_queue_new_buffer (GstAudioAggregator * aagg, pad->priv->position = 0; pad->priv->size = gst_buffer_get_size (inbuf) / bpf; + if (pad->priv->size == 0) { + if (!GST_BUFFER_DURATION_IS_VALID (inbuf) || + !GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_GAP)) { + GST_WARNING_OBJECT (pad, "Dropping 0-sized buffer missing either a" + " duration or a GAP flag: %" GST_PTR_FORMAT, inbuf); + return FALSE; + } + + pad->priv->size = gst_util_uint64_scale (GST_BUFFER_DURATION (inbuf), rate, + GST_SECOND); + } + if (!GST_BUFFER_PTS_IS_VALID (inbuf)) { if (pad->priv->output_offset == -1) pad->priv->output_offset = aagg->priv->offset; |