diff options
Diffstat (limited to 'gst')
-rw-r--r-- | gst/replaygain/gstrganalysis.c | 8 | ||||
-rw-r--r-- | gst/replaygain/gstrglimiter.c | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/gst/replaygain/gstrganalysis.c b/gst/replaygain/gstrganalysis.c index 24367786..613c0876 100644 --- a/gst/replaygain/gstrganalysis.c +++ b/gst/replaygain/gstrganalysis.c @@ -288,6 +288,10 @@ gst_rg_analysis_class_init (GstRgAnalysisClass * klass) static void gst_rg_analysis_init (GstRgAnalysis * filter, GstRgAnalysisClass * gclass) { + GstBaseTransform *base = GST_BASE_TRANSFORM (filter); + + gst_base_transform_set_gap_aware (base, TRUE); + filter->num_tracks = 0; filter->forced = FORCED_DEFAULT; filter->reference_level = RG_REFERENCE_LEVEL; @@ -452,6 +456,10 @@ gst_rg_analysis_transform_ip (GstBaseTransform * base, GstBuffer * buf) if (filter->skip) return GST_FLOW_OK; + /* Buffers made up of silence have no influence on the analysis: */ + if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)) + return GST_FLOW_OK; + GST_LOG_OBJECT (filter, "processing buffer of size %u", GST_BUFFER_SIZE (buf)); diff --git a/gst/replaygain/gstrglimiter.c b/gst/replaygain/gstrglimiter.c index 609db3d7..d474b26e 100644 --- a/gst/replaygain/gstrglimiter.c +++ b/gst/replaygain/gstrglimiter.c @@ -129,8 +129,12 @@ gst_rg_limiter_class_init (GstRgLimiterClass * klass) static void gst_rg_limiter_init (GstRgLimiter * filter, GstRgLimiterClass * gclass) { + GstBaseTransform *base = GST_BASE_TRANSFORM (filter); + + gst_base_transform_set_passthrough (base, FALSE); + gst_base_transform_set_gap_aware (base, TRUE); + filter->enabled = TRUE; - gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (filter), FALSE); } static void @@ -182,6 +186,9 @@ gst_rg_limiter_transform_ip (GstBaseTransform * base, GstBuffer * buf) if (!filter->enabled) return GST_FLOW_OK; + if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_GAP)) + return GST_FLOW_OK; + input = (gfloat *) GST_BUFFER_DATA (buf); count = GST_BUFFER_SIZE (buf) / sizeof (gfloat); |