Changes of Revision 10

mediatomb.changes Changed
x
 
1
@@ -1,4 +1,9 @@
2
 -------------------------------------------------------------------
3
+Fri Aug  9 11:49:26 UTC 2013 - obs@botter.cc
4
+
5
+- add patch to have mediatomb 0.12.1 compile against mp4v2 >= 2.0.0
6
+
7
+-------------------------------------------------------------------
8
 Mon Dec 10 17:54:44 UTC 2012 - lang@b1-systems.de
9
 
10
 - openSUSE 12.2 compat: Do not assume the dir for the pid file just exists
11
mediatomb.spec Changed
18
 
1
@@ -45,6 +45,8 @@
2
 Patch5:        mediatomb-0.12.1-libextractor-0.6.patch
3
 # PATCH-FIX-UPSTREAM - build with ffmpeg new API
4
 Patch6:         libavformat_0.11_support.patch
5
+# PATCH-FIX-UPSTREAM - build with mp4v2 >= 2.0.0
6
+Patch7:        mediatomb-0.12.1-mp4v2_2.0.0.patch
7
 Source90:       %{name}-rpmlintrc
8
 BuildRequires:  autoconf
9
 BuildRequires:  automake
10
@@ -180,6 +182,7 @@
11
 %patch4 -p1
12
 %patch5 -p1
13
 %patch6 -p1
14
+%patch7 -p1
15
 
16
 cp %{SOURCE2} .
17
 
18
mediatomb-0.12.1-mp4v2_2.0.0.patch Added
177
 
1
@@ -0,0 +1,175 @@
2
+diff -Naur mediatomb-0.12.1.svn2103.orig/src/metadata/libmp4v2_handler.cc mediatomb-0.12.1.svn2103/src/metadata/libmp4v2_handler.cc
3
+--- mediatomb-0.12.1.svn2103.orig/src/metadata/libmp4v2_handler.cc 2012-11-09 03:02:02.283176882 +0100
4
++++ mediatomb-0.12.1.svn2103/src/metadata/libmp4v2_handler.cc  2013-08-09 14:34:00.262756277 +0200
5
+@@ -62,28 +62,26 @@
6
+ {
7
+ }
8
+ 
9
+-static void addMetaField(metadata_fields_t field, MP4FileHandle mp4, Ref<CdsItem> item)
10
++static void addMetaField(metadata_fields_t field, const MP4Tags* mp4tags, Ref<CdsItem> item)
11
+ {
12
+     String value;
13
+     char*  mp4_retval = NULL;
14
+-    u_int16_t track;
15
+-    u_int16_t total_tracks;
16
+  
17
+     Ref<StringConverter> sc = StringConverter::i2i();
18
+     
19
+     switch (field)
20
+     {
21
+         case M_TITLE:
22
+-            MP4GetMetadataName(mp4, &mp4_retval);
23
++      mp4_retval = (char *)mp4tags->name;
24
+             break;
25
+         case M_ARTIST:
26
+-            MP4GetMetadataArtist(mp4, &mp4_retval);
27
++            mp4_retval = (char *)mp4tags->artist;
28
+             break;
29
+         case M_ALBUM:
30
+-            MP4GetMetadataAlbum(mp4, &mp4_retval);
31
++            mp4_retval = (char *)mp4tags->album;
32
+             break;
33
+         case M_DATE:
34
+-            MP4GetMetadataYear(mp4, &mp4_retval);
35
++            mp4_retval = (char *)mp4tags->releaseDate;
36
+             if (mp4_retval)
37
+             {
38
+                 value = mp4_retval;
39
+@@ -95,17 +93,16 @@
40
+             }
41
+             break;
42
+         case M_GENRE:
43
+-            MP4GetMetadataGenre(mp4, &mp4_retval);
44
++            mp4_retval = (char *)mp4tags->genre;
45
+             break;
46
+         case M_DESCRIPTION:
47
+-            MP4GetMetadataComment(mp4, &mp4_retval);
48
++            mp4_retval = (char *)mp4tags->description;
49
+             break;
50
+         case M_TRACKNUMBER:
51
+-            MP4GetMetadataTrack(mp4, &track, &total_tracks);
52
+-            if (track > 0)
53
++            if (mp4tags->track->index > 0)
54
+             {
55
+-                value = String::from(track);
56
+-                item->setTrackNumber((int)track);
57
++                value = String::from(mp4tags->track->index);
58
++                item->setTrackNumber((int)mp4tags->track->index);
59
+             }
60
+             else
61
+                 return;
62
+@@ -128,6 +125,7 @@
63
+         item->setMetadata(MT_KEYS[field].upnp, sc->convert(value));
64
+         log_debug("mp4 handler: setting metadata on item: %d, %s\n", field, sc->convert(value).c_str());
65
+     }
66
++
67
+ }
68
+ 
69
+ void LibMP4V2Handler::fillMetadata(Ref<CdsItem> item)
70
+@@ -145,8 +143,13 @@
71
+ 
72
+     try
73
+     {
74
++        /* allocate */
75
++        const MP4Tags* tags = MP4TagsAlloc();
76
++        /* fetch data from MP4 file and populate structure */
77
++        MP4TagsFetch( tags, mp4 );
78
++ 
79
+         for (int i = 0; i < M_MAX; i++)
80
+-            addMetaField((metadata_fields_t) i, mp4, item);
81
++            addMetaField((metadata_fields_t) i, tags, item);
82
+ 
83
+         Ref<ConfigManager> cm = ConfigManager::getInstance();
84
+ 
85
+@@ -190,32 +193,35 @@
86
+         }
87
+ 
88
+ #if defined(HAVE_MAGIC)
89
+-        u_int8_t *art_data;
90
+-        u_int32_t art_data_len;
91
++        //u_int8_t *art_data;
92
++        //u_int32_t art_data_len;
93
+         String art_mimetype;
94
++  const MP4TagArtwork *art;
95
+ #ifdef HAVE_MP4_GET_METADATA_COVER_ART_COUNT
96
+-        if (MP4GetMetadataCoverArtCount(mp4) && 
97
+-            MP4GetMetadataCoverArt(mp4, &art_data, &art_data_len))
98
++        //if (MP4GetMetadataCoverArtCount(mp4) && 
99
++        //    MP4GetMetadataCoverArt(mp4, &art_data, &art_data_len))
100
++  if (tags->artworkCount)
101
+ #else
102
+-            MP4GetMetadataCoverArt(mp4, &art_data, &art_data_len);
103
++            //MP4GetMetadataCoverArt(mp4, &art_data, &art_data_len);
104
+ #endif
105
+         {
106
+-            if (art_data)
107
++      art = tags->artwork;
108
++            if (art->data)
109
+             {
110
+                 try
111
+                 {
112
+-                    art_mimetype = ContentManager::getInstance()->getMimeTypeFromBuffer((void *)art_data, art_data_len);
113
++                    art_mimetype = ContentManager::getInstance()->getMimeTypeFromBuffer((void *)art->data, art->size);
114
+                     if (!string_ok(art_mimetype))
115
+                         art_mimetype = _(MIMETYPE_DEFAULT);
116
+ 
117
+                 }
118
+                 catch (Exception ex)
119
+                 {
120
+-                    free(art_data);
121
++                    //free(art_data);
122
+                     throw ex;
123
+                 }
124
+ 
125
+-                free(art_data);
126
++                //free(art_data);
127
+                 if (art_mimetype != _(MIMETYPE_DEFAULT))
128
+                 {
129
+                     Ref<CdsResource> resource(new CdsResource(CH_MP4));
130
+@@ -226,6 +232,7 @@
131
+             }
132
+         }
133
+ #endif
134
++  MP4TagsFree( tags );
135
+         MP4Close(mp4);
136
+     }
137
+     catch (Exception ex)
138
+@@ -247,24 +254,30 @@
139
+ 
140
+     String ctype = res->getParameters()->get(_(RESOURCE_CONTENT_TYPE));
141
+ 
142
++    const MP4Tags* tags = MP4TagsAlloc();
143
++    MP4TagsFetch( tags, mp4 );
144
++
145
+     if (ctype != ID3_ALBUM_ART)
146
+         throw _Exception(_("LibMP4V2Handler: got unknown content type: ") + ctype);
147
+ #ifdef HAVE_MP4_GET_METADATA_COVER_ART_COUNT
148
+-    if (!MP4GetMetadataCoverArtCount(mp4))
149
++    if (!tags->artworkCount)
150
+         throw _Exception(_("LibMP4V2Handler: resource has no album art information"));
151
+ #endif
152
+-    u_int8_t *art_data;
153
+-    u_int32_t art_data_len;
154
+-    if (MP4GetMetadataCoverArt(mp4, &art_data, &art_data_len))
155
++    //u_int8_t *art_data;
156
++    //u_int32_t art_data_len;
157
++    const MP4TagArtwork *art;
158
++    art = tags->artwork;
159
++    if (art)
160
+     {
161
+-        if (art_data)
162
++        if (art->data)
163
+         {
164
+-            *data_size = (off_t)art_data_len;
165
+-            Ref<IOHandler> h(new MemIOHandler((void *)art_data, art_data_len));
166
+-            free(art_data);
167
++            *data_size = (off_t)art->size;
168
++            Ref<IOHandler> h(new MemIOHandler((void *)art->data, art->size));
169
++            //free(art_data);
170
+             return h;
171
+         }
172
+     }
173
++    MP4TagsFree( tags );
174
+         
175
+     throw _Exception(_("LibMP4V2Handler: could not serve album art "
176
+                            "for file") + item->getLocation() + 
177