Commit fd81f27b authored by Olivier Crête's avatar Olivier Crête

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
parent 25ea37e7
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment