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.
This commit is contained in:
Tim-Philipp Müller 2018-09-12 00:52:19 +01:00
parent 3da5144bbe
commit 0d88e3553a

View file

@ -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;