Browse Source

Merge commit 'f128b8e19ac7f702adae899ab91cc1e80f238761'

* commit 'f128b8e19ac7f702adae899ab91cc1e80f238761':
  mov: detect cover art pictures by content

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
tags/n3.0
Hendrik Leppkes 9 years ago
parent
commit
df06cb5611
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      libavformat/mov.c

+ 8
- 0
libavformat/mov.c View File

@@ -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;


Loading…
Cancel
Save