From 0d88e3553aa585b1b803d43257602e08ba75ccf5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 12 Sep 2018 00:52:19 +0100 Subject: [PATCH] wavpackparse: fix handling of correction streams Accept wavpack correction streams (.wvc) on sink pad, so that wavpackparse can also be used to packetise correction streams. Fix parsing of subblock ID tags - the higher bits are flags and are not part of the ID. This resulted in correction blocks not being recognised properly and the output not having the right (correction) caps. --- gst/audioparsers/gstwavpackparse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/audioparsers/gstwavpackparse.c b/gst/audioparsers/gstwavpackparse.c index 3e1d19c..7dc34cf 100644 --- a/gst/audioparsers/gstwavpackparse.c +++ b/gst/audioparsers/gstwavpackparse.c @@ -61,7 +61,7 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("audio/x-wavpack")); + GST_STATIC_CAPS ("audio/x-wavpack; audio/x-wavpack-correction")); static void gst_wavpack_parse_finalize (GObject * object); @@ -325,7 +325,9 @@ gst_wavpack_parse_frame_metadata (GstWavpackParse * parse, GstBuffer * buf, CHECK (gst_byte_reader_get_data (&br, size + (size & 1), &data)); gst_byte_reader_init (&mbr, data, size); - switch (id) { + /* 0x1f is the metadata id mask and 0x20 flag is for later extensions + * that do not need to be handled by the decoder */ + switch (id & 0x3f) { case ID_WVC_BITSTREAM: GST_LOG_OBJECT (parse, "correction bitstream"); wpi->correction = TRUE; -- 2.7.4