diff options
author | James Almer <jamrial@gmail.com> | 2017-02-10 16:01:37 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-02-10 18:33:30 -0300 |
commit | 33ab1d4c6f6af4df6e06bd590e5d805bdf442881 (patch) | |
tree | 9853336d3aee9f72c7696f48edf9df32c16f0df9 /libavformat | |
parent | 84d874a680ff647bc84de44967b638f246a8b832 (diff) | |
download | ffmpeg-streaming-33ab1d4c6f6af4df6e06bd590e5d805bdf442881.zip ffmpeg-streaming-33ab1d4c6f6af4df6e06bd590e5d805bdf442881.tar.gz |
avformat/apetag: reorder some code to improve readability
This way it's clear the size field accounts for the footer length plus every
tag entry, but not the header.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/apetag.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/apetag.c b/libavformat/apetag.c index b23f8cd..cdc602e 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -192,10 +192,6 @@ int ff_ape_write_tag(AVFormatContext *s) if ((ret = avio_open_dyn_buf(&dyn_bc)) < 0) goto end; - // flags - avio_wl32(dyn_bc, APE_TAG_FLAG_CONTAINS_HEADER | APE_TAG_FLAG_IS_HEADER); - ffio_fill(dyn_bc, 0, 8); // reserved - ff_standardize_creation_time(s); while ((e = av_dict_get(s->metadata, "", e, AV_DICT_IGNORE_SUFFIX))) { int val_len; @@ -218,7 +214,7 @@ int ff_ape_write_tag(AVFormatContext *s) size = avio_close_dyn_buf(dyn_bc, &dyn_buf); if (size <= 0) goto end; - size += 20; + size += APE_TAG_FOOTER_BYTES; // header avio_write(s->pb, "APETAGEX", 8); // id @@ -226,7 +222,11 @@ int ff_ape_write_tag(AVFormatContext *s) avio_wl32(s->pb, size); avio_wl32(s->pb, count); - avio_write(s->pb, dyn_buf, size - 20); + // flags + avio_wl32(s->pb, APE_TAG_FLAG_CONTAINS_HEADER | APE_TAG_FLAG_IS_HEADER); + ffio_fill(s->pb, 0, 8); // reserved + + avio_write(s->pb, dyn_buf, size - APE_TAG_FOOTER_BYTES); // footer avio_write(s->pb, "APETAGEX", 8); // id |