flacparse: warn on wishful parsing of weird headers

If we get anything from 7 to 126 as type when parsing
a metadata block header, we are likely dealing with a
FLAC stream version we don't fully understand. Issue
a warning if so.

Document function assumptions regarding the passed-on
type while at this.
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2015-12-31 12:52:13 -08:00
parent df6f0bc595
commit 8a745837aa

View file

@ -1490,6 +1490,8 @@ gst_flac_parse_reset_buffer_time_and_offset (GstBuffer * buffer)
GST_BUFFER_OFFSET_END (buffer) = 0;
}
/* Type 127 is invalid for a metadata block header & should
* be discarded _before_ calling this function */
static gboolean
gst_flac_parse_handle_block_type (GstFlacParse * flacparse, guint type,
GstBuffer * sbuffer)
@ -1524,7 +1526,9 @@ gst_flac_parse_handle_block_type (GstFlacParse * flacparse, guint type,
GST_INFO_OBJECT (flacparse, "APPLICATION header");
break;
default: /* RESERVED */
GST_INFO_OBJECT (flacparse, "unhandled header of type %u", type);
GST_INFO_OBJECT (flacparse, "Unhandled metadata header type '%u'", type);
GST_WARNING_OBJECT (flacparse,
"FLAC version might not be fully supported");
break;
}