summaryrefslogtreecommitdiff
path: root/libavformat/omadec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-13 01:24:03 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-04-18 02:24:44 +0200
commit8068f2fcf33722875907e2fe25e81e1f05b1a476 (patch)
treef749d852ceaba88e7ea4e9ccbdef086d6539b38a /libavformat/omadec.c
parent9f834a1ac1dfb8e61b1edbaa57c880518abb0f17 (diff)
downloadffmpeg-8068f2fcf33722875907e2fe25e81e1f05b1a476.tar.gz
avformat/id3v2: Don't reverse the order of id3v2 APICs
When parsing ID3v2 tags, special (non-text) metadata is not applied directly and unconditionally; instead it is stored in a linked list in which elements are prepended. When traversing the list to add APICs (or private tags) at the end, the order is reversed. The same also happens for chapters and therefore the chapter parsing code already reverses the chapters. This commit changes this: By keeping pointers to both head and tail of the linked list one can preserve the order of the entries and remove the reordering code for chapters. Only the pointer to head will be exported: No current caller uses a nonempty list, so exporting both head and tail is unnecessary. This removes the functionality to combine the lists of special metadata read from different ID3v2 tags, but that doesn't make really much sense anyway (and would be trivial to implement if desired) and allows to remove the now unnecessary initializations performed by the callers. The FATE-reference for the id3v2-priv test had to be updated because the order of the tags read into the dict is reversed; for id3v2-priv-remux only the md5 and not the ffprobe output of the remuxed file changes because the order of the private tags has up until now been reversed twice. The references for the aiff/mp3 cover-art tests needed to be updated, because the order of the attached pics is reversed upon reading. It is still not correct, because the muxers write the pics in the order in which they arrive at the muxer instead of the order given by pkt->stream_index. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/omadec.c')
-rw-r--r--libavformat/omadec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index d31b475fd2..74b32db96d 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -413,7 +413,7 @@ static int oma_read_header(AVFormatContext *s)
uint8_t buf[EA3_HEADER_SIZE];
uint8_t *edata;
AVStream *st;
- ID3v2ExtraMeta *extra_meta = NULL;
+ ID3v2ExtraMeta *extra_meta;
OMAContext *oc = s->priv_data;
ff_id3v2_read(s, ID3v2_EA3_MAGIC, &extra_meta, 0);