flacparse: warn on wishful parsing of weird headers
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Thu, 31 Dec 2015 20:52:13 +0000 (12:52 -0800)
committerReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Thu, 31 Dec 2015 21:04:23 +0000 (13:04 -0800)
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.

gst/audioparsers/gstflacparse.c

index 9e89446..86e84ea 100644 (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;
   }