summaryrefslogtreecommitdiff
path: root/libavcodec/flac.h
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2009-02-26 02:29:24 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2009-02-26 02:29:24 +0000
commit59c6178a54c414fd19e064f0077d00b82a1eb812 (patch)
tree69bc8f09fc89959005fa8527d6822cc2eeea96c0 /libavcodec/flac.h
parentcaee91f7d038f80893b3c1ccdcd1bc44a9a19351 (diff)
Use a shared function to validate FLAC extradata.
Originally committed as revision 17602 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flac.h')
-rw-r--r--libavcodec/flac.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/flac.h b/libavcodec/flac.h
index 9a4f820831..8af79f2bd8 100644
--- a/libavcodec/flac.h
+++ b/libavcodec/flac.h
@@ -42,6 +42,11 @@ enum {
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 @@ typedef struct FLACStreaminfo {
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 */