volume: skip controlled processing if we have no timestamp
This commit is contained in:
parent
9c94a1812f
commit
fa9c0cdf6e
@ -718,7 +718,7 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
|
|||||||
GstAudioFilter *filter = GST_AUDIO_FILTER_CAST (base);
|
GstAudioFilter *filter = GST_AUDIO_FILTER_CAST (base);
|
||||||
GstVolume *self = GST_VOLUME (base);
|
GstVolume *self = GST_VOLUME (base);
|
||||||
GstMapInfo map;
|
GstMapInfo map;
|
||||||
GstControlBinding *mute_cb, *volume_cb;
|
GstClockTime ts;
|
||||||
|
|
||||||
if (G_UNLIKELY (!self->negotiated))
|
if (G_UNLIKELY (!self->negotiated))
|
||||||
goto not_negotiated;
|
goto not_negotiated;
|
||||||
@ -728,6 +728,11 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
|
|||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
gst_buffer_map (outbuf, &map, GST_MAP_READWRITE);
|
gst_buffer_map (outbuf, &map, GST_MAP_READWRITE);
|
||||||
|
ts = GST_BUFFER_TIMESTAMP (outbuf);
|
||||||
|
ts = gst_segment_to_stream_time (&base->segment, GST_FORMAT_TIME, ts);
|
||||||
|
|
||||||
|
if (GST_CLOCK_TIME_IS_VALID (ts)) {
|
||||||
|
GstControlBinding *mute_cb, *volume_cb;
|
||||||
|
|
||||||
mute_cb = gst_object_get_control_binding (GST_OBJECT (self), "mute");
|
mute_cb = gst_object_get_control_binding (GST_OBJECT (self), "mute");
|
||||||
volume_cb = gst_object_get_control_binding (GST_OBJECT (self), "volume");
|
volume_cb = gst_object_get_control_binding (GST_OBJECT (self), "volume");
|
||||||
@ -738,12 +743,9 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
|
|||||||
gint channels = GST_AUDIO_INFO_CHANNELS (&filter->info);
|
gint channels = GST_AUDIO_INFO_CHANNELS (&filter->info);
|
||||||
guint nsamples = map.size / (width * channels);
|
guint nsamples = map.size / (width * channels);
|
||||||
GstClockTime interval = gst_util_uint64_scale_int (1, GST_SECOND, rate);
|
GstClockTime interval = gst_util_uint64_scale_int (1, GST_SECOND, rate);
|
||||||
GstClockTime ts = GST_BUFFER_TIMESTAMP (outbuf);
|
|
||||||
gboolean have_mutes = FALSE;
|
gboolean have_mutes = FALSE;
|
||||||
gboolean have_volumes = FALSE;
|
gboolean have_volumes = FALSE;
|
||||||
|
|
||||||
ts = gst_segment_to_stream_time (&base->segment, GST_FORMAT_TIME, ts);
|
|
||||||
|
|
||||||
if (self->mutes_count < nsamples && mute_cb) {
|
if (self->mutes_count < nsamples && mute_cb) {
|
||||||
self->mutes = g_realloc (self->mutes, sizeof (gboolean) * nsamples);
|
self->mutes = g_realloc (self->mutes, sizeof (gboolean) * nsamples);
|
||||||
self->mutes_count = nsamples;
|
self->mutes_count = nsamples;
|
||||||
@ -784,6 +786,7 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
|
|||||||
} else if (volume_cb) {
|
} else if (volume_cb) {
|
||||||
gst_object_unref (volume_cb);
|
gst_object_unref (volume_cb);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (self->current_volume == 0.0 || self->current_mute) {
|
if (self->current_volume == 0.0 || self->current_mute) {
|
||||||
orc_memset (map.data, 0, map.size);
|
orc_memset (map.data, 0, map.size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user