diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/metadata/mp4.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/apps/metadata/mp4.c b/apps/metadata/mp4.c index a431231e12..4feb56cf98 100644 --- a/apps/metadata/mp4.c +++ b/apps/metadata/mp4.c | |||
@@ -33,6 +33,11 @@ | |||
33 | #include "debug.h" | 33 | #include "debug.h" |
34 | #include "replaygain.h" | 34 | #include "replaygain.h" |
35 | 35 | ||
36 | #ifdef DEBUGF | ||
37 | #undef DEBUGF | ||
38 | #define DEBUGF(...) | ||
39 | #endif | ||
40 | |||
36 | #define MP4_3gp6 FOURCC('3', 'g', 'p', '6') | 41 | #define MP4_3gp6 FOURCC('3', 'g', 'p', '6') |
37 | #define MP4_aART FOURCC('a', 'A', 'R', 'T') | 42 | #define MP4_aART FOURCC('a', 'A', 'R', 'T') |
38 | #define MP4_alac FOURCC('a', 'l', 'a', 'c') | 43 | #define MP4_alac FOURCC('a', 'l', 'a', 'c') |
@@ -45,6 +50,7 @@ | |||
45 | #define MP4_cwrt FOURCC(0xa9, 'w', 'r', 't') | 50 | #define MP4_cwrt FOURCC(0xa9, 'w', 'r', 't') |
46 | #define MP4_ccmt FOURCC(0xa9, 'c', 'm', 't') | 51 | #define MP4_ccmt FOURCC(0xa9, 'c', 'm', 't') |
47 | #define MP4_cday FOURCC(0xa9, 'd', 'a', 'y') | 52 | #define MP4_cday FOURCC(0xa9, 'd', 'a', 'y') |
53 | #define MP4_covr FOURCC('c', 'o', 'v', 'r') | ||
48 | #define MP4_disk FOURCC('d', 'i', 's', 'k') | 54 | #define MP4_disk FOURCC('d', 'i', 's', 'k') |
49 | #define MP4_esds FOURCC('e', 's', 'd', 's') | 55 | #define MP4_esds FOURCC('e', 's', 'd', 's') |
50 | #define MP4_ftyp FOURCC('f', 't', 'y', 'p') | 56 | #define MP4_ftyp FOURCC('f', 't', 'y', 'p') |
@@ -461,6 +467,32 @@ static bool read_mp4_tags(int fd, struct mp3entry* id3, | |||
461 | } | 467 | } |
462 | break; | 468 | break; |
463 | 469 | ||
470 | #ifdef HAVE_ALBUMART | ||
471 | case MP4_covr: | ||
472 | { | ||
473 | int pos = lseek(fd, 0, SEEK_CUR) + 16; | ||
474 | |||
475 | read_mp4_tag(fd, size, buffer, 8); | ||
476 | id3->albumart.type = AA_TYPE_UNKNOWN; | ||
477 | if (memcmp(buffer, "\xff\xd8\xff\xe0", 4) == 0) | ||
478 | { | ||
479 | id3->albumart.type = AA_TYPE_JPG; | ||
480 | } | ||
481 | else if (memcmp(buffer, "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a", 8) == 0) | ||
482 | { | ||
483 | id3->albumart.type = AA_TYPE_PNG; | ||
484 | } | ||
485 | |||
486 | if (id3->albumart.type != AA_TYPE_UNKNOWN) | ||
487 | { | ||
488 | id3->albumart.pos = pos; | ||
489 | id3->albumart.size = size - 16; | ||
490 | id3->embed_albumart = true; | ||
491 | } | ||
492 | } | ||
493 | break; | ||
494 | #endif | ||
495 | |||
464 | case MP4_extra: | 496 | case MP4_extra: |
465 | { | 497 | { |
466 | char tag_name[TAG_NAME_LENGTH]; | 498 | char tag_name[TAG_NAME_LENGTH]; |