diff flac.h @ 9054:7eedb5796dd8 libavcodec

Use a shared function to validate FLAC extradata.
author jbr
date Thu, 26 Feb 2009 02:29:24 +0000
parents e9d9d946f213
children 4984f305def8
line wrap: on
line diff
--- a/flac.h	Thu Feb 26 01:54:16 2009 +0000
+++ b/flac.h	Thu Feb 26 02:29:24 2009 +0000
@@ -42,6 +42,11 @@
     FLAC_METADATA_TYPE_INVALID = 127
 };
 
+enum FLACExtradataFormat {
+    FLAC_EXTRADATA_FORMAT_STREAMINFO  = 0,
+    FLAC_EXTRADATA_FORMAT_FULL_HEADER = 1
+};
+
 /**
  * Data needed from the Streaminfo header for use by the raw FLAC demuxer
  * and/or the FLAC decoder.
@@ -68,4 +73,15 @@
 void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
                               const uint8_t *buffer);
 
+/**
+ * Validate the FLAC extradata.
+ * @param[in]  avctx codec context containing the extradata.
+ * @param[out] format extradata format.
+ * @param[out] streaminfo_start pointer to start of 34-byte STREAMINFO data.
+ * @return 1 if valid, 0 if not valid.
+ */
+int ff_flac_is_extradata_valid(AVCodecContext *avctx,
+                               enum FLACExtradataFormat *format,
+                               uint8_t **streaminfo_start);
+
 #endif /* AVCODEC_FLAC_H */