By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 346
Collapse All | Expand All

(-)a/amarok/configure.in.in (-2 / +15 lines)
Lines 995-1009 if test "$have_mp4v2" != "no"; then Link Here
995
    ac_cppflags_save=$CPPFLAGS
995
    ac_cppflags_save=$CPPFLAGS
996
    CPPFLAGS="$CPPFLAGS -I."
996
    CPPFLAGS="$CPPFLAGS -I."
997
    AC_CHECK_HEADERS(systems.h)
997
    AC_CHECK_HEADERS(systems.h)
998
    AC_CHECK_HEADERS([mp4v2/mp4v2.h], [have_mp4_h=yes], [],
998
    AC_CHECK_HEADERS([mp4v2/mp4v2.h], [have_mp4v2_h=yes], [],
999
        [#ifdef HAVE_SYSTEMS_H
999
        [#ifdef HAVE_SYSTEMS_H
1000
         # include <systems.h>
1000
         # include <systems.h>
1001
         #endif
1001
         #endif
1002
        ])
1002
        ])
1003
    if test "$have_mp4v2_h" = "yes"; then
1004
        AC_DEFINE(HAVE_MP4V2_H, 1, [have mp4v2 h])
1005
    else
1006
        AC_CHECK_HEADERS([mp4.h], [have_mp4_h=yes], [],
1007
            [#ifdef HAVE_SYSTEMS_H
1008
             # include <systems.h>
1009
             #endif
1010
            ])
1011
        if test "$have_mp4_h" = "yes"; then
1012
            AC_DEFINE(HAVE_MP4_H, 1, [have mp4 h])
1013
            have_mp4v2_h=yes
1014
        fi
1015
    fi
1003
1016
1004
    AC_CHECK_LIB( mp4v2, MP4Read, have_mp4v2=yes, have_mp4v2=no )
1017
    AC_CHECK_LIB( mp4v2, MP4Read, have_mp4v2=yes, have_mp4v2=no )
1005
1018
1006
    if test "$have_mp4v2" = "yes" -a "$have_mp4_h" = "yes"; then
1019
    if test "$have_mp4v2" = "yes" -a "$have_mp4v2_h" = "yes"; then
1007
        AC_DEFINE(HAVE_MP4V2, 1, [have mp4v2])
1020
        AC_DEFINE(HAVE_MP4V2, 1, [have mp4v2])
1008
        MP4V2_INCLUDES="-I$mp4v2_dir/include"
1021
        MP4V2_INCLUDES="-I$mp4v2_dir/include"
1009
        MP4V2_LIBS="-L$mp4v2_dir/lib -lmp4v2"
1022
        MP4V2_LIBS="-L$mp4v2_dir/lib -lmp4v2"
(-)a/amarok/src/metadata/mp4/mp4file.cpp (-3 / +63 lines)
Lines 23-28 email : aumuell@reserv.at Link Here
23
 *   MA  02110-1301  USA                                                   *
23
 *   MA  02110-1301  USA                                                   *
24
 ***************************************************************************/
24
 ***************************************************************************/
25
25
26
#include <config.h>
27
26
#include "mp4file.h"
28
#include "mp4file.h"
27
29
28
#include "mp4tag.h"
30
#include "mp4tag.h"
Lines 34-40 email : aumuell@reserv.at Link Here
34
#include <stdlib.h>
36
#include <stdlib.h>
35
#include <sys/types.h>
37
#include <sys/types.h>
36
38
39
#ifdef HAVE_MP4V2_H
40
#define USE_ITMF_TAGS
41
#else
37
#define MP4V2_HAS_WRITE_BUG 1
42
#define MP4V2_HAS_WRITE_BUG 1
43
#endif
38
44
39
namespace TagLib {
45
namespace TagLib {
40
////////////////////////////////////////////////////////////////////////////////
46
////////////////////////////////////////////////////////////////////////////////
Lines 102-107 bool MP4::File::save() Link Here
102
        return false;
108
        return false;
103
    }
109
    }
104
110
111
#ifdef USE_ITMF_TAGS
112
    const MP4Tags* filetags = MP4TagsAlloc();
113
    MP4TagsFetch(filetags, handle);
114
#endif
115
105
#ifdef MP4V2_HAS_WRITE_BUG
116
#ifdef MP4V2_HAS_WRITE_BUG
106
    /* according to gtkpod we have to delete all meta data before modifying it,
117
    /* according to gtkpod we have to delete all meta data before modifying it,
107
       save the stuff we would not touch */
118
       save the stuff we would not touch */
Lines 117-123 bool MP4::File::save() Link Here
117
#endif
128
#endif
118
129
119
130
120
131
#ifdef USE_ITMF_TAGS
132
    MP4TagsSetName(filetags, mp4tag->title().isNull() ? "" : mp4tag->title().toCString(true));
133
    MP4TagsSetArtist(filetags, mp4tag->artist().isNull() ? "" : mp4tag->artist().toCString(true));
134
    MP4TagsSetAlbum(filetags, mp4tag->album().isNull() ? "" : mp4tag->album().toCString(true));
135
    MP4TagsSetComments(filetags, mp4tag->comment().isNull() ? "" : mp4tag->comment().toCString(true));
136
    MP4TagsSetGenre(filetags, mp4tag->genre().isNull() ? "" : mp4tag->genre().toCString(true));
137
    MP4TagsSetComposer(filetags, mp4tag->composer().isNull() ? "" : mp4tab->composer().toCString(true));
138
#else
121
#define setmeta(val, tag) \
139
#define setmeta(val, tag) \
122
    if(mp4tag->val().isNull()) { \
140
    if(mp4tag->val().isNull()) { \
123
        /*MP4DeleteMetadata##tag(handle);*/ \
141
        /*MP4DeleteMetadata##tag(handle);*/ \
Lines 125-151 bool MP4::File::save() Link Here
125
    } else { \
143
    } else { \
126
        MP4SetMetadata##tag(handle, mp4tag->val().toCString(true)); \
144
        MP4SetMetadata##tag(handle, mp4tag->val().toCString(true)); \
127
    }
145
    }
128
129
    setmeta(title, Name);
146
    setmeta(title, Name);
130
    setmeta(artist, Artist);
147
    setmeta(artist, Artist);
131
    setmeta(album, Album);
148
    setmeta(album, Album);
132
    setmeta(comment, Comment);
149
    setmeta(comment, Comment);
133
    setmeta(genre, Genre);
150
    setmeta(genre, Genre);
151
    setmeta(composer, Writer);
152
#endif
134
153
135
    char buf[100] = "";
154
    char buf[100] = "";
136
    if(mp4tag->year())
155
    if(mp4tag->year())
137
        snprintf(buf, sizeof(buf), "%u", mp4tag->year());
156
        snprintf(buf, sizeof(buf), "%u", mp4tag->year());
157
#ifdef USE_ITMF_TAGS
158
    MP4TagsSetReleaseDate(filetags, buf);
159
#else
138
    MP4SetMetadataYear(handle, buf);
160
    MP4SetMetadataYear(handle, buf);
161
#endif
139
    u_int16_t t1, t2;
162
    u_int16_t t1, t2;
163
164
#ifdef USE_ITMF_TAGS
165
    MP4TagTrack track = *filetags->track;
166
    track.index = t1;
167
    MP4TagsSetTrack(filetags, &track);
168
#else
140
    MP4GetMetadataTrack(handle, &t1, &t2);
169
    MP4GetMetadataTrack(handle, &t1, &t2);
141
    MP4SetMetadataTrack(handle, mp4tag->track(), t2);
170
    MP4SetMetadataTrack(handle, mp4tag->track(), t2);
142
    if(mp4tag->bpm() != 0)
171
#endif
172
    if(mp4tag->bpm() != 0) {
173
#ifdef USE_ITMF_TAGS
174
        u_int16_t tempo = mp4tag->bpm();
175
        MP4TagsSetTempo(filetags, &tempo);
176
#else
143
        MP4SetMetadataTempo(handle, mp4tag->bpm());
177
        MP4SetMetadataTempo(handle, mp4tag->bpm());
178
#endif
179
    }
144
    if(mp4tag->compilation() != MP4::Tag::Undefined) {
180
    if(mp4tag->compilation() != MP4::Tag::Undefined) {
181
#ifdef USE_ITMF_TAGS
182
        u_int8_t compilation = mp4tag->compilation();
183
        MP4TagsSetCompilation(filetags, &compilation);
184
#else
145
        MP4SetMetadataCompilation(handle, mp4tag->compilation());
185
        MP4SetMetadataCompilation(handle, mp4tag->compilation());
186
#endif
146
    }
187
    }
147
188
189
#ifdef USE_ITMF_TAGS
190
    if(mp4tag->cover().size()) {
191
        MP4TagArtwork art;
192
        art.size = mp4tag->cover().size();
193
        art.data = mp4tag->cover().size() ? const_cast<u_int8_t *>( reinterpret_cast<const u_int8_t *>( mp4tag->cover().data() ) ) : 0;
194
        art.type = MP4_ART_UNDEFINED; // delegate typing to libmp4v2
195
        if(filetags->artworkCount > 0) {
196
            MP4TagsSetArtwork(filetags, 0, &art);
197
        }
198
        else {
199
            MP4TagsAddArtwork(filetags, &art);
200
        }
201
    }
202
#else
148
    MP4SetMetadataCoverArt(handle, mp4tag->cover().size() ? const_cast<u_int8_t *>( reinterpret_cast<const u_int8_t *>( mp4tag->cover().data() ) ) : 0, mp4tag->cover().size());
203
    MP4SetMetadataCoverArt(handle, mp4tag->cover().size() ? const_cast<u_int8_t *>( reinterpret_cast<const u_int8_t *>( mp4tag->cover().data() ) ) : 0, mp4tag->cover().size());
204
#endif
149
205
150
#ifdef MP4V2_HAS_WRITE_BUG
206
#ifdef MP4V2_HAS_WRITE_BUG
151
    // set the saved data again
207
    // set the saved data again
Lines 159-164 bool MP4::File::save() Link Here
159
    }
215
    }
160
#endif
216
#endif
161
217
218
#ifdef USE_ITMF_TAGS
219
    MP4TagsStore(filetags, handle);
220
    MP4TagsFree(filetags);
221
#endif
162
    MP4Close(handle);
222
    MP4Close(handle);
163
223
164
    mp4file = MP4Read(name());
224
    mp4file = MP4Read(name());
(-)a/amarok/src/metadata/mp4/mp4properties.h (-1 / +8 lines)
Lines 22-34 email : andrew.leadbetter@gmail.com Link Here
22
#ifndef TAGLIB_MP4PROPERTIES_H
22
#ifndef TAGLIB_MP4PROPERTIES_H
23
#define TAGLIB_MP4PROPERTIES_H
23
#define TAGLIB_MP4PROPERTIES_H
24
24
25
#include <config.h>
26
25
#include <audioproperties.h>
27
#include <audioproperties.h>
26
#include <tstring.h>
28
#include <tstring.h>
27
#include <mp4v2/mp4v2.h>
29
#ifdef HAVE_MP4V2_H
30
# include <mp4v2/mp4v2.h>
31
#endif
32
#ifdef HAVE_MP4_H
33
# include <mp4.h>
28
// mp4.h drags in mp4_config.h that defines these
34
// mp4.h drags in mp4_config.h that defines these
29
// get rid of them so they don't conflict with our config.h
35
// get rid of them so they don't conflict with our config.h
30
#undef VERSION
36
#undef VERSION
31
#undef PACKAGE
37
#undef PACKAGE
38
#endif
32
39
33
namespace TagLib {
40
namespace TagLib {
34
41
(-)a/amarok/src/metadata/mp4/mp4tag.cpp (-2 / +54 lines)
Lines 20-25 email : andrew.leadbetter@gmail.com Link Here
20
 *   MA  02110-1301  USA                                                   *
20
 *   MA  02110-1301  USA                                                   *
21
 ***************************************************************************/
21
 ***************************************************************************/
22
22
23
#include <config.h>
24
23
#include "mp4tag.h"
25
#include "mp4tag.h"
24
26
25
#include <tag.h>
27
#include <tag.h>
Lines 29-34 email : andrew.leadbetter@gmail.com Link Here
29
#include <stdlib.h>
31
#include <stdlib.h>
30
#include <sys/types.h>
32
#include <sys/types.h>
31
33
34
#ifdef HAVE_MP4V2_H
35
#define USE_ITMF_TAGS
36
#endif
37
32
using namespace TagLib;
38
using namespace TagLib;
33
39
34
MP4::Tag::Tag() : TagLib::Tag::Tag() {
40
MP4::Tag::Tag() : TagLib::Tag::Tag() {
Lines 67-87 void MP4::Tag::duplicate(const Tag *source, Tag *target, bool overwrite) { Link Here
67
    // Duplicate standard information
73
    // Duplicate standard information
68
    Tag::duplicate(source, target, overwrite);
74
    Tag::duplicate(source, target, overwrite);
69
75
70
    if (overwrite || target->compilation() == Undefined && source->compilation() != Undefined)
76
    if ((overwrite || target->compilation() == Undefined) && (source->compilation() != Undefined)) {
71
        target->setCompilation(source->compilation());
77
        target->setCompilation(source->compilation());
78
    }
72
79
73
    if (overwrite || target->cover().size() == 0)
80
    if (overwrite || target->cover().size() == 0) {
74
        target->setCover(source->cover());
81
        target->setCover(source->cover());
82
    }
75
}
83
}
76
84
77
void MP4::Tag::readTags( MP4FileHandle mp4file )
85
void MP4::Tag::readTags( MP4FileHandle mp4file )
78
{
86
{
79
    // Now parse tag.
87
    // Now parse tag.
88
#ifdef USE_ITMF_TAGS
89
    const MP4Tags* filetags = MP4TagsAlloc();
90
    MP4TagsFetch(filetags, mp4file);
91
92
    if(filetags->name != NULL) {
93
        m_title = String(filetags->name, String::UTF8);
94
    }
95
    if(filetags->artist != NULL) {
96
        m_artist = String(filetags->artist, String::UTF8);
97
    }
98
    if(filetags->comments != NULL) {
99
        m_comment = String(filetags->comments, String::UTF8);
100
    }
101
    if(filetags->releaseDate != NULL) {
102
        m_year = strtol(filetags->releaseDate, NULL, 0);
103
    }
104
    if(filetags->album != NULL) {
105
        m_album = String(filetags->album, String::UTF8);
106
    }
107
    if(filetags->track != NULL) {
108
        m_track = filetags->track->index;
109
    }
110
    if(filetags->disk != NULL) {
111
        m_disk = filetags->disk->index;
112
    }
113
    if(filetags->tempo != NULL) {
114
        m_bpm = *filetags->tempo;
115
    }
116
    if(filetags->compilation != NULL) {
117
        m_compilation = *filetags->compilation;
118
    }
119
    if(filetags->genre != NULL) {
120
        m_genre = String(filetags->genre, String::UTF8);
121
    }
122
    if(filetags->composer != NULL) {
123
        m_composer = String(filetags->composer, String::UTF8);
124
    }
125
    if(filetags->artworkCount > 0) {
126
        m_image.setData(reinterpret_cast<const char *>( filetags->artwork[0].data ), filetags->artwork[0].size);
127
    }
128
    MP4TagsFree(filetags);
129
#else
80
    char *value;
130
    char *value;
81
    uint8_t boolvalue;
131
    uint8_t boolvalue;
82
    uint16_t numvalue, numvalue2;
132
    uint16_t numvalue, numvalue2;
83
    uint8_t *image;
133
    uint8_t *image;
84
    uint32_t imageSize;
134
    uint32_t imageSize;
135
85
    if (MP4GetMetadataName(mp4file, &value) && value != NULL) {
136
    if (MP4GetMetadataName(mp4file, &value) && value != NULL) {
86
        m_title = String(value, String::UTF8);
137
        m_title = String(value, String::UTF8);
87
        free(value);
138
        free(value);
Lines 128-131 void MP4::Tag::readTags( MP4FileHandle mp4file ) Link Here
128
        m_image.setData(reinterpret_cast<const char *>( image ), imageSize);
179
        m_image.setData(reinterpret_cast<const char *>( image ), imageSize);
129
        free(image);
180
        free(image);
130
    }
181
    }
182
#endif
131
}
183
}
(-)a/amarok/src/metadata/mp4/mp4tag.h (-1 / +8 lines)
Lines 21-29 email : andrew.leadbetter@gmail.com Link Here
21
#ifndef TAGLIB_MP4TAG_H
21
#ifndef TAGLIB_MP4TAG_H
22
#define TAGLIB_MP4TAG_H
22
#define TAGLIB_MP4TAG_H
23
23
24
#include <config.h>
25
24
#include <tag.h>
26
#include <tag.h>
25
#include "mp4file.h"
27
#include "mp4file.h"
26
#include <mp4v2/mp4v2.h>
28
#ifdef HAVE_MP4V2_H
29
# include <mp4v2/mp4v2.h>
30
#endif
31
#ifdef HAVE_MP4_H
32
# include <mp4.h>
33
#endif
27
34
28
namespace TagLib {
35
namespace TagLib {
29
36
(-)a/amarok/src/metadata/mp4/taglib_mp4filetyperesolver.cpp (-1 / +5 lines)
Lines 36-42 TagLib::File *MP4FileTypeResolver::createFile(const char *fileName, Link Here
36
                || !strcasecmp(ext, ".mp4")
36
                || !strcasecmp(ext, ".mp4")
37
                || !strcasecmp(ext, ".m4v") || !strcasecmp(ext, ".mp4v")))
37
                || !strcasecmp(ext, ".m4v") || !strcasecmp(ext, ".mp4v")))
38
    {
38
    {
39
        MP4FileHandle h = MP4Read(fileName, 0);
39
#if defined(MP4V2_PROJECT_version_hex) && MP4V2_PROJECT_version_hex >= 0x00020000
40
        MP4FileHandle h = ::MP4Read(fileName);
41
#else
42
        MP4FileHandle h = ::MP4Read(fileName, 0);
43
#endif
40
        if(MP4_INVALID_FILE_HANDLE == h)
44
        if(MP4_INVALID_FILE_HANDLE == h)
41
        {
45
        {
42
            return 0;
46
            return 0;
(-)a/config.h.in (+3 lines)
Lines 106-111 Link Here
106
/* have mp4v2 */
106
/* have mp4v2 */
107
#undef HAVE_MP4V2
107
#undef HAVE_MP4V2
108
108
109
/* Define to 1 if you have the <mp4v2/mp4v2.h> header file. */
110
#undef HAVE_MP4V2_H
111
109
/* Define to 1 if you have the <mp4.h> header file. */
112
/* Define to 1 if you have the <mp4.h> header file. */
110
#undef HAVE_MP4_H
113
#undef HAVE_MP4_H
111
114

Return to bug 346