summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2021-04-01 14:26:45 +0300
committerMartin Storsjö <martin@martin.st>2021-07-15 10:25:35 +0300
commita99dd5f6a4cf263bdbbb18f6b665f3399995ab26 (patch)
treeec602ae66fc0fbdcd2258df7fbd14e2fc53e4a28 /libavformat/mov.c
parent7ec7e6aa2d394d8d25472c55c5da2e44b0a60041 (diff)
mov: Pick up "com.apple.quicktime.artwork" as cover art
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 2e061a55d1..329bf3b207 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -402,7 +402,18 @@ retry:
str_size = data_size - 16;
atom.size -= 16;
- if (atom.type == MKTAG('c', 'o', 'v', 'r')) {
+ if (!key && c->found_hdlr_mdta && c->meta_keys) {
+ uint32_t index = AV_RB32(&atom.type);
+ if (index < c->meta_keys_count && index > 0) {
+ key = c->meta_keys[index];
+ } else if (atom.type != MKTAG('c', 'o', 'v', 'r')) {
+ av_log(c->fc, AV_LOG_WARNING,
+ "The index of 'data' is out of range: %"PRId32" < 1 or >= %d.\n",
+ index, c->meta_keys_count);
+ }
+ }
+ if (atom.type == MKTAG('c', 'o', 'v', 'r') ||
+ (key && !strcmp(key, "com.apple.quicktime.artwork"))) {
int ret = mov_read_covr(c, pb, data_type, str_size);
if (ret < 0) {
av_log(c->fc, AV_LOG_ERROR, "Error parsing cover art.\n");
@@ -412,15 +423,6 @@ retry:
if (atom.size > 8)
goto retry;
return ret;
- } else if (!key && c->found_hdlr_mdta && c->meta_keys) {
- uint32_t index = AV_RB32(&atom.type);
- if (index < c->meta_keys_count && index > 0) {
- key = c->meta_keys[index];
- } else {
- av_log(c->fc, AV_LOG_WARNING,
- "The index of 'data' is out of range: %"PRId32" < 1 or >= %d.\n",
- index, c->meta_keys_count);
- }
}
} else return 0;
} else if (atom.size > 4 && key && !c->itunes_metadata && !raw) {