audioparsers: add back segment clipping to parsers that have lost it
authorMart Raudsepp <mart.raudsepp@collabora.com>
Mon, 24 Jun 2019 11:28:39 +0000 (14:28 +0300)
committerMart Raudsepp <mart.raudsepp@collabora.com>
Mon, 24 Jun 2019 11:40:58 +0000 (14:40 +0300)
The pre_push_frame default clipping behaviour was introduced in 2010
with commit 30be03004e82 and modified with commit 4163969a2422 in 2011,
when most parsers didn't implement a pre_push_frame yet. Not having it
meant that clipping was done by default. Those that did implement a
pre_push_frame (flacparse and mpegaudioparse) at the time, had the flag
adjusted as part of the 2011 refactor work.

All other parsers got a pre_push_frame vfunc implementation only in
2013, but seem to have forgot to keep the clipping behaviour, as
was done automatically when a pre_push_frame implementation doesn't
exist for the parser. aacparse lost it with commit 91d4abcea in
July 2013; the others in Dec 2013 as part of AUDIO_CODEC tag posting
in commits 6f89b430ed2ab5199b29f2cae12753d3c23a and 292780574.

gst/audioparsers/gstaacparse.c
gst/audioparsers/gstac3parse.c
gst/audioparsers/gstamrparse.c
gst/audioparsers/gstdcaparse.c
gst/audioparsers/gstsbcparse.c
gst/audioparsers/gstwavpackparse.c

index 0d4bf84..42ef981 100644 (file)
@@ -1480,6 +1480,8 @@ gst_aac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
         gst_buffer_get_size (frame->out_buffer) - header_size);
   }
 
+  frame->flags |= GST_BASE_PARSE_FRAME_FLAG_CLIP;
+
   return GST_FLOW_OK;
 }
 
index 0c4cbe6..d797aa0 100644 (file)
@@ -808,6 +808,8 @@ gst_ac3_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
     ac3parse->sent_codec_tag = TRUE;
   }
 
+  frame->flags |= GST_BASE_PARSE_FRAME_FLAG_CLIP;
+
   return GST_FLOW_OK;
 }
 
index 2b62777..190f707 100644 (file)
@@ -448,5 +448,7 @@ gst_amr_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
     amrparse->sent_codec_tag = TRUE;
   }
 
+  frame->flags |= GST_BASE_PARSE_FRAME_FLAG_CLIP;
+
   return GST_FLOW_OK;
 }
index 0d06f53..fd7c1f0 100644 (file)
@@ -613,5 +613,7 @@ gst_dca_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
     dcaparse->sent_codec_tag = TRUE;
   }
 
+  frame->flags |= GST_BASE_PARSE_FRAME_FLAG_CLIP;
+
   return GST_FLOW_OK;
 }
index fd521f8..494f9cb 100644 (file)
@@ -530,5 +530,7 @@ gst_sbc_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
     sbcparse->sent_codec_tag = TRUE;
   }
 
+  frame->flags |= GST_BASE_PARSE_FRAME_FLAG_CLIP;
+
   return GST_FLOW_OK;
 }
index df0e223..3e37f8a 100644 (file)
@@ -704,5 +704,7 @@ gst_wavpack_parse_pre_push_frame (GstBaseParse * parse,
     wavpackparse->sent_codec_tag = TRUE;
   }
 
+  frame->flags |= GST_BASE_PARSE_FRAME_FLAG_CLIP;
+
   return GST_FLOW_OK;
 }