summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-11-10 18:01:36 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-11-10 18:01:36 +0100
commitdf06cb561102488f09c9ef24494cc7dd843cad1a (patch)
tree3c8bcb539562b665c5a8a38a7688078eedbc410b /libavformat
parent3a8b37c5904fe6a92a0104c8f3879596fe3a3c24 (diff)
parentf128b8e19ac7f702adae899ab91cc1e80f238761 (diff)
Merge commit 'f128b8e19ac7f702adae899ab91cc1e80f238761'
* commit 'f128b8e19ac7f702adae899ab91cc1e80f238761': mov: detect cover art pictures by content Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 11c83583ee..a7ba4d8ae2 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -194,6 +194,14 @@ static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
if (ret < 0)
return ret;
+ if (pkt.size >= 8 && id != AV_CODEC_ID_BMP) {
+ if (AV_RB64(pkt.data) == 0x89504e470d0a1a0a) {
+ id = AV_CODEC_ID_PNG;
+ } else {
+ id = AV_CODEC_ID_MJPEG;
+ }
+ }
+
st->disposition |= AV_DISPOSITION_ATTACHED_PIC;
st->attached_pic = pkt;