mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-06-29 03:10:40 +00:00
audioconvert: Clip input buffers to the segment before handling them
https://bugzilla.gnome.org/show_bug.cgi?id=757068
This commit is contained in:
parent
736a27fe1e
commit
000c424835
|
@ -88,6 +88,8 @@ static GstFlowReturn gst_audio_convert_transform (GstBaseTransform * base,
|
||||||
GstBuffer * inbuf, GstBuffer * outbuf);
|
GstBuffer * inbuf, GstBuffer * outbuf);
|
||||||
static gboolean gst_audio_convert_transform_meta (GstBaseTransform * trans,
|
static gboolean gst_audio_convert_transform_meta (GstBaseTransform * trans,
|
||||||
GstBuffer * outbuf, GstMeta * meta, GstBuffer * inbuf);
|
GstBuffer * outbuf, GstMeta * meta, GstBuffer * inbuf);
|
||||||
|
static GstFlowReturn gst_audio_convert_submit_input_buffer (GstBaseTransform *
|
||||||
|
base, gboolean is_discont, GstBuffer * input);
|
||||||
static void gst_audio_convert_set_property (GObject * object, guint prop_id,
|
static void gst_audio_convert_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec);
|
const GValue * value, GParamSpec * pspec);
|
||||||
static void gst_audio_convert_get_property (GObject * object, guint prop_id,
|
static void gst_audio_convert_get_property (GObject * object, guint prop_id,
|
||||||
|
@ -222,6 +224,8 @@ gst_audio_convert_class_init (GstAudioConvertClass * klass)
|
||||||
GST_DEBUG_FUNCPTR (gst_audio_convert_transform);
|
GST_DEBUG_FUNCPTR (gst_audio_convert_transform);
|
||||||
basetransform_class->transform_meta =
|
basetransform_class->transform_meta =
|
||||||
GST_DEBUG_FUNCPTR (gst_audio_convert_transform_meta);
|
GST_DEBUG_FUNCPTR (gst_audio_convert_transform_meta);
|
||||||
|
basetransform_class->submit_input_buffer =
|
||||||
|
GST_DEBUG_FUNCPTR (gst_audio_convert_submit_input_buffer);
|
||||||
|
|
||||||
basetransform_class->passthrough_on_same_caps = TRUE;
|
basetransform_class->passthrough_on_same_caps = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -886,6 +890,25 @@ gst_audio_convert_transform_meta (GstBaseTransform * trans, GstBuffer * outbuf,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstFlowReturn
|
||||||
|
gst_audio_convert_submit_input_buffer (GstBaseTransform * base,
|
||||||
|
gboolean is_discont, GstBuffer * input)
|
||||||
|
{
|
||||||
|
GstAudioConvert *this = GST_AUDIO_CONVERT (base);
|
||||||
|
|
||||||
|
if (base->segment.format == GST_FORMAT_TIME) {
|
||||||
|
input =
|
||||||
|
gst_audio_buffer_clip (input, &base->segment, this->ctx.in.rate,
|
||||||
|
this->ctx.in.bpf);
|
||||||
|
|
||||||
|
if (!input)
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GST_BASE_TRANSFORM_CLASS (parent_class)->submit_input_buffer (base,
|
||||||
|
is_discont, input);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_audio_convert_set_property (GObject * object, guint prop_id,
|
gst_audio_convert_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec)
|
const GValue * value, GParamSpec * pspec)
|
||||||
|
|
Loading…
Reference in a new issue