Changeset b59b5633c5d4fce70a9dddfb3e3230b0eaa64f73
- Timestamp:
- 09/24/06 16:56:46
(2 years ago)
- Author:
- Clément Stenac <zorglub@videolan.org>
- git-committer:
- Clément Stenac <zorglub@videolan.org> 1159109806 +0000
- git-parent:
[be82b7aebdc2046d4030bcac847d811d038fed0d]
- git-author:
- Clément Stenac <zorglub@videolan.org> 1159109806 +0000
- Message:
Detect embedded images
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r47bfbd7 |
rb59b563 |
|
| 27 | 27 | #include <fileref.h> |
|---|
| 28 | 28 | #include <tag.h> |
|---|
| | 29 | #include <id3v2tag.h> |
|---|
| | 30 | #include <mpegfile.h> |
|---|
| 29 | 31 | |
|---|
| 30 | 32 | static int ReadMeta ( vlc_object_t * ); |
|---|
| … | … | |
| 34 | 36 | set_callbacks( ReadMeta, NULL ); |
|---|
| 35 | 37 | vlc_module_end(); |
|---|
| 36 | | |
|---|
| | 38 | |
|---|
| | 39 | bool checkID3Image( const TagLib::ID3v2::Tag *tag ) |
|---|
| | 40 | { |
|---|
| | 41 | TagLib::ID3v2::FrameList l = tag->frameListMap()[ "APIC" ]; |
|---|
| | 42 | return !l.isEmpty(); |
|---|
| | 43 | } |
|---|
| | 44 | |
|---|
| | 45 | |
|---|
| 37 | 46 | static int ReadMeta( vlc_object_t *p_this ) |
|---|
| 38 | 47 | { |
|---|
| … | … | |
| 51 | 60 | vlc_meta_SetTitle( p_meta, tag->title().toCString( true ) ); |
|---|
| 52 | 61 | vlc_meta_SetArtist( p_meta, tag->artist().toCString( true ) ); |
|---|
| | 62 | |
|---|
| | 63 | if( TagLib::MPEG::File *mpeg = |
|---|
| | 64 | dynamic_cast<TagLib::MPEG::File *>(f.file() ) ) |
|---|
| | 65 | { |
|---|
| | 66 | if( mpeg->ID3v2Tag() && checkID3Image( mpeg->ID3v2Tag() ) ) |
|---|
| | 67 | { |
|---|
| | 68 | fprintf( stderr, "%s has APIC\n", p_meta->psz_title ); |
|---|
| | 69 | vlc_meta_SetArtURL( p_meta, "APIC" ); /// Means that the interface will use us to actually fetch it |
|---|
| | 70 | } |
|---|
| | 71 | } |
|---|
| 53 | 72 | return VLC_SUCCESS; |
|---|
| 54 | 73 | } |
|---|