summaryrefslogtreecommitdiff
path: root/libavformat/id3v2.h
diff options
context:
space:
mode:
authorLukas Stabe <lukas@stabe.de>2017-10-05 03:34:19 +0200
committerwm4 <nfxjfg@googlemail.com>2017-10-05 17:10:23 +0200
commit1fd80106be3dca9fa0ea13fb364c8d221bd27c15 (patch)
treee820d55b354b49746bbf46f62860de7d20ed8d19 /libavformat/id3v2.h
parentcafd9d66ed9e1bad4ae579a3935f7af57a567a51 (diff)
avformat: fix id3 chapters
These changes store id3 chapter data in ID3v2ExtraMeta and introduce ff_id3v2_parse_chapters to parse them into the format context if needed. Encoders using ff_id3v2_read, which previously parsed chapters into the format context automatically, were adjusted to call ff_id3v2_parse_chapters. Signed-off-by: wm4 <nfxjfg@googlemail.com>
Diffstat (limited to 'libavformat/id3v2.h')
-rw-r--r--libavformat/id3v2.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/libavformat/id3v2.h b/libavformat/id3v2.h
index 6e7a8c9abf..5e64ead096 100644
--- a/libavformat/id3v2.h
+++ b/libavformat/id3v2.h
@@ -79,6 +79,12 @@ typedef struct ID3v2ExtraMetaPRIV {
uint32_t datasize;
} ID3v2ExtraMetaPRIV;
+typedef struct ID3v2ExtraMetaCHAP {
+ uint8_t *element_id;
+ uint32_t start, end;
+ AVDictionary *meta;
+} ID3v2ExtraMetaCHAP;
+
/**
* Detect ID3v2 Header.
* @param buf must be ID3v2_HEADER_SIZE byte long
@@ -97,8 +103,6 @@ int ff_id3v2_tag_len(const uint8_t *buf);
/**
* Read an ID3v2 tag into specified dictionary and retrieve supported extra metadata.
*
- * Chapters are not currently read by this variant.
- *
* @param metadata Parsed metadata is stored here
* @param extra_meta If not NULL, extra metadata is parsed into a list of
* ID3v2ExtraMeta structs and *extra_meta points to the head of the list
@@ -106,7 +110,7 @@ int ff_id3v2_tag_len(const uint8_t *buf);
void ff_id3v2_read_dict(AVIOContext *pb, AVDictionary **metadata, const char *magic, ID3v2ExtraMeta **extra_meta);
/**
- * Read an ID3v2 tag, including supported extra metadata and chapters.
+ * Read an ID3v2 tag, including supported extra metadata.
*
* Data is read from and stored to AVFormatContext.
*
@@ -158,6 +162,11 @@ void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta);
*/
int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta);
+/**
+ * Create chapters for all CHAP tags found in the ID3v2 header.
+ */
+int ff_id3v2_parse_chapters(AVFormatContext *s, ID3v2ExtraMeta **extra_meta);
+
extern const AVMetadataConv ff_id3v2_34_metadata_conv[];
extern const AVMetadataConv ff_id3v2_4_metadata_conv[];