Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
libavformat: Add format context parameter to ff_id3v2_read_dict
The format context (when not NULL) is used to store chapter information,
which was not previously supported by ff_id3v2_read_dict.
This fixes https://trac.ffmpeg.org/ticket/6558
Loading branch information
Showing
4 changed files
with
8 additions
and
6 deletions .
+1
−1
libavformat/hls.c
+2
−2
libavformat/id3v2.c
+4
−2
libavformat/id3v2.h
+1
−1
libavformat/utils.c
@@ -909,7 +909,7 @@ static void parse_id3(AVFormatContext *s, AVIOContext *pb,
static const char id3_priv_owner_ts[] = " com.apple.streaming.transportStreamTimestamp" ;
ID3v2ExtraMeta *meta;
ff_id3v2_read_dict (pb, metadata, ID3v2_DEFAULT_MAGIC, extra_meta);
ff_id3v2_read_dict (NULL , pb, metadata, ID3v2_DEFAULT_MAGIC, extra_meta);
for (meta = *extra_meta; meta; meta = meta->next ) {
if (!strcmp (meta->tag , " PRIV" )) {
ID3v2ExtraMetaPRIV *priv = meta->data ;
@@ -1097,10 +1097,10 @@ static void id3v2_read_internal(AVIOContext *pb, AVDictionary **metadata,
merge_date (metadata);
}
void ff_id3v2_read_dict (AVIOContext *pb, AVDictionary **metadata,
void ff_id3v2_read_dict (AVFormatContext *s, AVIOContext *pb, AVDictionary **metadata,
const char *magic, ID3v2ExtraMeta **extra_meta)
{
id3v2_read_internal (pb, metadata, NULL , magic, extra_meta, 0 );
id3v2_read_internal (pb, metadata, s , magic, extra_meta, 0 );
}
void ff_id3v2_read (AVFormatContext *s, const char *magic,
@@ -97,13 +97,15 @@ 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.
* Chapters are not currently only read by this variant when s is not NULL .
*
* @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
* @param s If not NULL, chapter information is stored in the provided context
*/
void ff_id3v2_read_dict (AVIOContext *pb, AVDictionary **metadata, const char *magic, ID3v2ExtraMeta **extra_meta);
void ff_id3v2_read_dict (AVFormatContext *s, AVIOContext *pb, AVDictionary **metadata,
const char *magic, ID3v2ExtraMeta **extra_meta);
/* *
* Read an ID3v2 tag, including supported extra metadata and chapters.
@@ -588,7 +588,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename,
/* e.g. AVFMT_NOFILE formats will not have a AVIOContext */
if (s->pb )
ff_id3v2_read_dict (s->pb , &s->internal ->id3v2_meta , ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
ff_id3v2_read_dict (s, s ->pb , &s->internal ->id3v2_meta , ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
if (!(s->flags &AVFMT_FLAG_PRIV_OPT) && s->iformat ->read_header )
Toggle all file notes
Toggle all file annotations