1 |
commit: 294d8e32d9aa77e8b005083eba471b6690de3d77 |
2 |
Author: Ian Whyman <thev00d00 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 4 17:56:01 2018 +0000 |
4 |
Commit: Ian Whyman <thev00d00 <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 4 17:59:43 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=294d8e32 |
7 |
|
8 |
net-misc/mediatomb: Drop from tree. Use net-misc/gerbera instead |
9 |
|
10 |
net-misc/mediatomb/Manifest | 3 - |
11 |
net-misc/mediatomb/files/mediatomb-0.12.0.confd | 28 - |
12 |
net-misc/mediatomb/files/mediatomb-0.12.0.config | 144 ----- |
13 |
.../files/mediatomb-0.12.1-flac-metadata.patch | 446 -------------- |
14 |
.../mediatomb-0.12.1-inotify-hard-links.patch | 34 -- |
15 |
.../files/mediatomb-0.12.1-libextractor.patch | 675 --------------------- |
16 |
.../files/mediatomb-0.12.1-libmp4v2.patch | 187 ------ |
17 |
.../files/mediatomb-0.12.1-mozjs187.patch | 260 -------- |
18 |
.../files/mediatomb-0.12.1-system-ar.patch | 35 -- |
19 |
.../files/mediatomb-0.12.1-system-uuid.patch | 36 -- |
20 |
.../files/mediatomb-0.12.1-thumb-cache.patch | 237 -------- |
21 |
.../files/mediatomb-0.12.1-thumbnail-locking.patch | 71 --- |
22 |
.../mediatomb/files/mediatomb-0.12.1-time-t.patch | 56 -- |
23 |
.../files/mediatomb-0.12.1-youtube-dl.patch | 141 ----- |
24 |
net-misc/mediatomb/files/mediatomb-0.12.1.initd | 28 - |
25 |
net-misc/mediatomb/mediatomb-0.12.1-r8.ebuild | 158 ----- |
26 |
.../mediatomb/mediatomb-0.12.2_pre20160522.ebuild | 122 ---- |
27 |
net-misc/mediatomb/metadata.xml | 28 - |
28 |
18 files changed, 2689 deletions(-) |
29 |
|
30 |
diff --git a/net-misc/mediatomb/Manifest b/net-misc/mediatomb/Manifest |
31 |
deleted file mode 100644 |
32 |
index 62333afd39d..00000000000 |
33 |
--- a/net-misc/mediatomb/Manifest |
34 |
+++ /dev/null |
35 |
@@ -1,3 +0,0 @@ |
36 |
-DIST mediatomb-0.12.1.tar.gz 1240612 BLAKE2B ecf20fed1805b5b18005d1045624947380838774a40d3ed675dffd29fb72c222a4b245fcbc88f5e53c4a6a38cc4d495a400a1530acd03972d25c6394d07edde8 SHA512 36e7269a532a79c91b4ea7be36f92cbefa913a1f856e422e46fe2b97ee7a569dd20c38b0cbe651a8e7faacde892ea18f3cac66c3c0737480c44f9b9bc3a45438 |
37 |
-DIST mediatomb-0.12.2_pre20160522.tar.gz 2415058 BLAKE2B f8cc15bb8a2cbabbf9962ec9e3f1f527798c63c1722a383731200e9161fd474479160fcd86c2afb85ef6ff7a5f171a3c5883c19dc14cf1605885edf5fd0a5021 SHA512 b45c81f548013b8fc0de84e02e47c8acbf21c359a6c41a5f13addfdd9d084ee58b23b776da4dce4da1f924a80a02835c622245165da09107c0b89786e5a69804 |
38 |
-DIST mediatomb_0.12.1-5.debian.tar.gz 36001 BLAKE2B 18fb0c1e572749e71b0462b0e633b2a3bb86a98f294e29ceba7257fe77177257dd7994d3cee58d13b87ee643fd7e6c46868e3c3b90f5cd6d320962750c45b923 SHA512 420cf0d4fc0aa82337f2893ef18f04f9d079d833f2540d6bee504d423e8acee5e5ae528d97f5cd4228d6648777c62d6186532f7a74d3d0cb04f9226a2de1dd95 |
39 |
|
40 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.0.confd b/net-misc/mediatomb/files/mediatomb-0.12.0.confd |
41 |
deleted file mode 100644 |
42 |
index 7f5c0083025..00000000000 |
43 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.0.confd |
44 |
+++ /dev/null |
45 |
@@ -1,28 +0,0 @@ |
46 |
-# /etc/conf.d/mediatomb: config file for /etc/init.d/mediatomb |
47 |
- |
48 |
-# See the mediatomb(1) manpage for more info. |
49 |
- |
50 |
-# MediaTomb Web UI port. |
51 |
-# NOTE: The minimum value allowed is 49152 |
52 |
-MEDIATOMB_PORT=49152 |
53 |
- |
54 |
-# Run MediaTomb as this user. |
55 |
-# NOTE: For security reasons do not run MediaTomb as root. |
56 |
-MEDIATOMB_USER="mediatomb" |
57 |
- |
58 |
-# Run MediaTomb as this group. |
59 |
-# NOTE: For security reasons do not run MediaTomb as root. |
60 |
-MEDIATOMB_GROUP="mediatomb" |
61 |
- |
62 |
-# Path to MediaTomb config file. |
63 |
-MEDIATOMB_CONFIG="/etc/mediatomb/config.xml" |
64 |
- |
65 |
-# Path to MediaTomb log file. |
66 |
-MEDIATOMB_LOGFILE="/var/log/mediatomb.log" |
67 |
- |
68 |
-# Path to MediaTomb pid file. |
69 |
-MEDIATOMB_PIDFILE="/var/run/mediatomb.pid" |
70 |
- |
71 |
-# Other options you want to pass to MediaTomb. |
72 |
-# Add "--interface ${MEDIATOMB_INTERFACE}" to bind to a named interface. |
73 |
-MEDIATOMB_OPTIONS="" |
74 |
|
75 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.0.config b/net-misc/mediatomb/files/mediatomb-0.12.0.config |
76 |
deleted file mode 100644 |
77 |
index 0cd03b15d8e..00000000000 |
78 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.0.config |
79 |
+++ /dev/null |
80 |
@@ -1,144 +0,0 @@ |
81 |
-<?xml version="1.0" encoding="UTF-8"?> |
82 |
-<config version="2" xmlns="http://mediatomb.cc/config/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/2 http://mediatomb.cc/config/2.xsd"> |
83 |
- <server> |
84 |
- <ui enabled="yes" show-tooltips="yes"> |
85 |
- <accounts enabled="no" session-timeout="30"> |
86 |
- <account user="mediatomb" password="mediatomb"/> |
87 |
- </accounts> |
88 |
- </ui> |
89 |
- <name>MediaTomb</name> |
90 |
- <udn></udn> |
91 |
- <home>/var/lib/mediatomb</home> |
92 |
- <webroot>/usr/share/mediatomb/web</webroot> |
93 |
- <storage> |
94 |
- <sqlite3 enabled="yes"> |
95 |
- <database-file>mediatomb.db</database-file> |
96 |
- </sqlite3> |
97 |
- <mysql enabled="no"> |
98 |
- <host>host</host> |
99 |
- <database>database</database> |
100 |
- <username>username</username> |
101 |
- <password>password</password> |
102 |
- </mysql> |
103 |
- </storage> |
104 |
- <protocolInfo extend="yes"/> |
105 |
- <pc-directory upnp-hide="no"/> |
106 |
- <extended-runtime-options> |
107 |
- <ffmpegthumbnailer enabled="no"> |
108 |
- <thumbnail-size>160</thumbnail-size> |
109 |
- <seek-percentage>10</seek-percentage> |
110 |
- <filmstrip-overlay>no</filmstrip-overlay> |
111 |
- <workaround-bugs>no</workaround-bugs> |
112 |
- <image-quality>8</image-quality> |
113 |
- </ffmpegthumbnailer> |
114 |
- <mark-played-items enabled="no" suppress-cds-updates="yes"> |
115 |
- <string mode="prepend">*</string> |
116 |
- <mark> |
117 |
- <content>video</content> |
118 |
- </mark> |
119 |
- </mark-played-items> |
120 |
- <lastfm enabled="no"> |
121 |
- <username>username</username> |
122 |
- <password>password</password> |
123 |
- </lastfm> |
124 |
- </extended-runtime-options> |
125 |
- </server> |
126 |
- <import hidden-files="no"> |
127 |
- <scripting script-charset="UTF-8"> |
128 |
- <common-script>/usr/share/mediatomb/js/common.js</common-script> |
129 |
- <playlist-script>/usr/share/mediatomb/js/playlists.js</playlist-script> |
130 |
- <virtual-layout type="builtin"> |
131 |
- <import-script>/usr/share/mediatomb/js/import.js</import-script> |
132 |
- </virtual-layout> |
133 |
- </scripting> |
134 |
- <mappings> |
135 |
- <extension-mimetype ignore-unknown="no"> |
136 |
- <map from="mp3" to="audio/mpeg"/> |
137 |
- <map from="ogx" to="application/ogg"/> |
138 |
- <map from="ogv" to="video/ogg"/> |
139 |
- <map from="oga" to="audio/ogg"/> |
140 |
- <map from="ogg" to="audio/ogg"/> |
141 |
- <map from="ogm" to="video/ogg"/> |
142 |
- <map from="asf" to="video/x-ms-asf"/> |
143 |
- <map from="asx" to="video/x-ms-asf"/> |
144 |
- <map from="wma" to="audio/x-ms-wma"/> |
145 |
- <map from="wax" to="audio/x-ms-wax"/> |
146 |
- <map from="wmv" to="video/x-ms-wmv"/> |
147 |
- <map from="wvx" to="video/x-ms-wvx"/> |
148 |
- <map from="wm" to="video/x-ms-wm"/> |
149 |
- <map from="wmx" to="video/x-ms-wmx"/> |
150 |
- <map from="m3u" to="audio/x-mpegurl"/> |
151 |
- <map from="pls" to="audio/x-scpls"/> |
152 |
- <map from="flv" to="video/x-flv"/> |
153 |
- <map from="mkv" to="video/x-matroska"/> |
154 |
- <map from="mka" to="audio/x-matroska"/> |
155 |
- <map from="avi" to="video/divx"/> |
156 |
- <map from="m2ts" to="video/avc"/> |
157 |
- <map from="cr2" to="image/raw"/> |
158 |
- <map from="nef" to="image/raw"/> |
159 |
- </extension-mimetype> |
160 |
- <mimetype-upnpclass> |
161 |
- <map from="audio/*" to="object.item.audioItem.musicTrack"/> |
162 |
- <map from="video/*" to="object.item.videoItem"/> |
163 |
- <map from="image/*" to="object.item.imageItem"/> |
164 |
- </mimetype-upnpclass> |
165 |
- <mimetype-contenttype> |
166 |
- <treat mimetype="audio/mpeg" as="mp3"/> |
167 |
- <treat mimetype="application/ogg" as="ogg"/> |
168 |
- <treat mimetype="video/ogg" as="ogg"/> |
169 |
- <treat mimetype="audio/ogg" as="ogg"/> |
170 |
- <treat mimetype="audio/x-flac" as="flac"/> |
171 |
- <treat mimetype="image/jpeg" as="jpg"/> |
172 |
- <treat mimetype="audio/x-mpegurl" as="playlist"/> |
173 |
- <treat mimetype="audio/x-scpls" as="playlist"/> |
174 |
- <treat mimetype="audio/x-wav" as="pcm"/> |
175 |
- <treat mimetype="audio/L16" as="pcm"/> |
176 |
- <treat mimetype="video/x-msvideo" as="avi"/> |
177 |
- <treat mimetype="video/mp4" as="mp4"/> |
178 |
- <treat mimetype="audio/mp4" as="mp4"/> |
179 |
- <treat mimetype="video/divx" as="avi"/> |
180 |
- </mimetype-contenttype> |
181 |
- </mappings> |
182 |
- <online-content> |
183 |
- <YouTube enabled="no" refresh="28800" update-at-start="yes" purge-after="604800" racy-content="exclude" format="mp4" hd="no"> |
184 |
- <favorites user="NationalGeographic"/> |
185 |
- <playlists user="PlayStation"/> |
186 |
- <uploads user="Google"/> |
187 |
- <standardfeed feed="most_viewed" time-range="today"/> |
188 |
- <standardfeed feed="recently_featured" time-range="today"/> |
189 |
- </YouTube> |
190 |
- </online-content> |
191 |
- </import> |
192 |
- <transcoding enabled="no"> |
193 |
- <mimetype-profile-mappings> |
194 |
- <transcode mimetype="audio/ogg" using="audio2pcm"/> |
195 |
- <transcode mimetype="audio/x-flac" using="audio2pcm"/> |
196 |
- <transcode mimetype="video/ogg" using="video2mpeg"/> |
197 |
- <transcode mimetype="video/x-flv" using="video2mpeg"/> |
198 |
- </mimetype-profile-mappings> |
199 |
- <profiles> |
200 |
- <profile name="audio2pcm" enabled="yes" type="external"> |
201 |
- <mimetype>audio/L16</mimetype> |
202 |
- <accept-url>no</accept-url> |
203 |
- <first-resource>yes</first-resource> |
204 |
- <hide-original-resource>yes</hide-original-resource> |
205 |
- <accept-ogg-theora>no</accept-ogg-theora> |
206 |
- <sample-frequency>44100</sample-frequency> |
207 |
- <audio-channels>2</audio-channels> |
208 |
- <agent command="ffmpeg" arguments="-i %in -acodec pcm_s16be -ab 192k -ar 44100 -ac 2 -f s16be -y %out"/> |
209 |
- <buffer size="1048576" chunk-size="131072" fill-size="262144"/> |
210 |
- </profile> |
211 |
- <profile name="video2mpeg" enabled="yes" type="external"> |
212 |
- <mimetype>video/mpeg</mimetype> |
213 |
- <accept-url>no</accept-url> |
214 |
- <first-resource>yes</first-resource> |
215 |
- <hide-original-resource>yes</hide-original-resource> |
216 |
- <accept-ogg-theora>yes</accept-ogg-theora> |
217 |
- <sample-frequency>48000</sample-frequency> |
218 |
- <audio-channels>2</audio-channels> |
219 |
- <agent command="ffmpeg" arguments="-i %in -vcodec mpeg2video -b 4096k -r 25 -acodec mp2 -ab 192k -ar 48000 -ac 2 -async 1 -f dvd -threads 2 -y %out"/> |
220 |
- <buffer size="10485760" chunk-size="262144" fill-size="524288"/> |
221 |
- </profile> |
222 |
- </profiles> |
223 |
- </transcoding> |
224 |
-</config> |
225 |
|
226 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1-flac-metadata.patch b/net-misc/mediatomb/files/mediatomb-0.12.1-flac-metadata.patch |
227 |
deleted file mode 100644 |
228 |
index 0228dffd08d..00000000000 |
229 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1-flac-metadata.patch |
230 |
+++ /dev/null |
231 |
@@ -1,446 +0,0 @@ |
232 |
-diff -urpN a/build/Makefile.am b/build/Makefile.am |
233 |
---- a/build/Makefile.am 2010-03-22 21:39:46.000000000 +1100 |
234 |
-+++ b/build/Makefile.am 2013-12-16 10:16:32.426878578 +1100 |
235 |
-@@ -18,6 +18,7 @@ libmediatomb_a_CXXFLAGS = \ |
236 |
- $(ICONV_CXXFLAGS) \ |
237 |
- $(LIBMAGIC_CFLAGS) \ |
238 |
- $(ID3LIB_CFLAGS) \ |
239 |
-+ $(FLAC_CFLAGS) \ |
240 |
- $(LIBEXIF_CFLAGS) \ |
241 |
- $(ZLIB_CFLAGS) \ |
242 |
- $(PTHREAD_CFLAGS) \ |
243 |
-@@ -44,6 +45,7 @@ mediatomb_CXXFLAGS = -I$(top_srcdir)/src |
244 |
- $(ICONV_CXXFLAGS) \ |
245 |
- $(LIBMAGIC_CFLAGS) \ |
246 |
- $(ID3LIB_CFLAGS) \ |
247 |
-+ $(FLAC_CFLAGS) \ |
248 |
- $(LIBEXIF_CFLAGS) \ |
249 |
- $(ZLIB_CFLAGS) \ |
250 |
- $(PTHREAD_CFLAGS) \ |
251 |
-@@ -78,6 +80,7 @@ mediatomb_LDADD = \ |
252 |
- $(JS_LIBS) \ |
253 |
- $(LIBMAGIC_LIBS) \ |
254 |
- $(ID3LIB_LIBS) \ |
255 |
-+ $(FLAC_LIBS) \ |
256 |
- $(LIBEXIF_LIBS) \ |
257 |
- $(ZLIB_LIBS) \ |
258 |
- $(RT_LIBS) \ |
259 |
-diff -urpN a/build/libmediatomb_src b/build/libmediatomb_src |
260 |
---- a/build/libmediatomb_src 2010-03-23 04:09:53.000000000 +1100 |
261 |
-+++ b/build/libmediatomb_src 2013-12-16 10:14:49.730356868 +1100 |
262 |
-@@ -98,6 +98,8 @@ libmediatomb_a_SOURCES = \ |
263 |
- ../src/metadata/libmp4v2_handler.h \ |
264 |
- ../src/metadata/taglib_handler.cc \ |
265 |
- ../src/metadata/taglib_handler.h \ |
266 |
-+../src/metadata/flac_handler.cc \ |
267 |
-+../src/metadata/flac_handler.h \ |
268 |
- ../src/mpegdemux/buffer.c \ |
269 |
- ../src/mpegdemux/buffer.h \ |
270 |
- ../src/mpegdemux/mpegdemux.c \ |
271 |
-diff -urpN a/configure.ac b/configure.ac |
272 |
---- a/configure.ac 2010-04-08 08:38:51.000000000 +1000 |
273 |
-+++ b/configure.ac 2013-12-16 10:24:16.547793225 +1100 |
274 |
-@@ -1314,6 +1314,35 @@ LDFLAGS="$LDFLAGS_SAVE" |
275 |
- LIBS="$LIBS_SAVE" |
276 |
- CXXFLAGS="$CXXFLAGS_SAVE" |
277 |
- CPPFLAGS="$CPPFLAGS_SAVE" |
278 |
-+ |
279 |
-+######### FLAC |
280 |
-+ |
281 |
-+FLAC_STATUS= |
282 |
-+ |
283 |
-+MT_OPTION([FLAC], [enable], |
284 |
-+ [FLAC metadata extraction with the help of FLAC],[],[]) |
285 |
-+ |
286 |
-+if test "x$FLAC_OPTION_ENABLED" = xyes; then |
287 |
-+ MT_CHECK_PACKAGE([FLAC], |
288 |
-+ [FLAC/metadata], |
289 |
-+ [FLAC], [main]) |
290 |
-+else |
291 |
-+ FLAC_STATUS=disabled |
292 |
-+fi |
293 |
-+ |
294 |
-+if test "x$FLAC_STATUS" != xyes; then |
295 |
-+ if (test "x$FLAC_OPTION_REQUESTED" = xyes) && |
296 |
-+ (test "x$FLAC_OPTION_ENABLED" = xyes); then |
297 |
-+ AC_MSG_ERROR([unable to configure FLAC support]) |
298 |
-+ fi |
299 |
-+else |
300 |
-+ CFLAGS="$CFLAGS $FLAC_CFLAGS" |
301 |
-+ CXXFLAGS="$CXXFLAGS $FLAC_CFLAGS" |
302 |
-+ LDFLAGS="$LDFLAGS $FLAC_LDFLAGS $FLAC_LIBS" |
303 |
-+ AC_LANG_SAVE |
304 |
-+ AC_LANG_CPLUSPLUS |
305 |
-+fi |
306 |
-+ |
307 |
- ######## curl |
308 |
- |
309 |
- CURL_PROG_FOUND=0 |
310 |
-@@ -1914,7 +1943,7 @@ if (test "x$SOPCAST_OPTION_ENABLED" = xy |
311 |
- AC_DEFINE([SOPCAST], [1], [Enable support for the SopCast service]) |
312 |
- fi |
313 |
- |
314 |
--AC_DEFINE_UNQUOTED([COMPILE_INFO], "\thost:\t\t\t$host\n\tsqlite3:\t\t$SQLITE3_STATUS\n\tmysql:\t\t\t$MYSQL_STATUS\n\tlibjs:\t\t\t$JS_OK\n\tlibmagic:\t\t$LIBMAGIC_STATUS\n\tinotify:\t\t$INOTIFY_STATUS\n\tlibexif:\t\t$LIBEXIF_STATUS\n\tid3lib:\t\t\t$ID3LIB_STATUS\n\ttaglib:\t\t\t$TAGLIB_STATUS\n\tffmpeg\t\t\t$FFMPEG_STATUS\n\tlibmp4v2:\t\t$LIBMP4V2_STATUS\n\texternal transcoding:\t$EXTERNAL_TRANSCODING_OPTION_ENABLED\n\tcurl:\t\t\t$CURL_OK\n\tYouTube:\t\t$YOUTUBE_OPTION_ENABLED\n\tlibextractor\t\t$LIBEXTRACTOR_STATUS\n\tdb-autocreate:\t\t$DB_AUTOCREATE_OPTION_ENABLED\n\tdebug log:\t\t$DEBUG_LOG_OPTION_ENABLED\n\tprotocol info extension:$PROTOCOLINFO_EXTENSION_OPTION_ENABLED\n\tffmpegthumbnailer:\t$FFMPEGTHUMBNAILER_STATUS\n\tlastfmlib:\t\t$LASTFMLIB_STATUS\n\tdata directory:\t\t$PACKAGE_DATADIR", [compile option summary]) |
315 |
-+AC_DEFINE_UNQUOTED([COMPILE_INFO], "\thost:\t\t\t$host\n\tsqlite3:\t\t$SQLITE3_STATUS\n\tmysql:\t\t\t$MYSQL_STATUS\n\tlibjs:\t\t\t$JS_OK\n\tlibmagic:\t\t$LIBMAGIC_STATUS\n\tinotify:\t\t$INOTIFY_STATUS\n\tlibexif:\t\t$LIBEXIF_STATUS\n\tid3lib:\t\t\t$ID3LIB_STATUS\n\ttaglib:\t\t\t$TAGLIB_STATUS\n\tFLAC:\t\t\t$FLAC_STATUS\n\tffmpeg\t\t\t$FFMPEG_STATUS\n\tlibmp4v2:\t\t$LIBMP4V2_STATUS\n\texternal transcoding:\t$EXTERNAL_TRANSCODING_OPTION_ENABLED\n\tcurl:\t\t\t$CURL_OK\n\tYouTube:\t\t$YOUTUBE_OPTION_ENABLED\n\tlibextractor\t\t$LIBEXTRACTOR_STATUS\n\tdb-autocreate:\t\t$DB_AUTOCREATE_OPTION_ENABLED\n\tdebug log:\t\t$DEBUG_LOG_OPTION_ENABLED\n\tprotocol info extension:$PROTOCOLINFO_EXTENSION_OPTION_ENABLED\n\tffmpegthumbnailer:\t$FFMPEGTHUMBNAILER_STATUS\n\tlastfmlib:\t\t$LASTFMLIB_STATUS\n\tdata directory:\t\t$PACKAGE_DATADIR", [compile option summary]) |
316 |
- |
317 |
- ############### |
318 |
- AC_CONFIG_FILES([ |
319 |
-@@ -1946,6 +1975,7 @@ echo "inotify : $INOTIFY_S |
320 |
- echo "libexif : $LIBEXIF_STATUS" |
321 |
- echo "id3lib : $ID3LIB_STATUS" |
322 |
- echo "taglib : $TAGLIB_STATUS" |
323 |
-+echo "FLAC : $FLAC_STATUS" |
324 |
- echo "libmp4v2 : $LIBMP4V2_STATUS" |
325 |
- echo "ffmpeg : $FFMPEG_STATUS" |
326 |
- echo "ffmpegthumbnailer : $FFMPEGTHUMBNAILER_STATUS" |
327 |
-diff -urpN a/src/cds_resource_manager.cc b/src/cds_resource_manager.cc |
328 |
---- a/src/cds_resource_manager.cc 2010-03-26 01:58:11.000000000 +1100 |
329 |
-+++ b/src/cds_resource_manager.cc 2013-12-16 10:25:15.277987292 +1100 |
330 |
-@@ -372,6 +372,7 @@ void CdsResourceManager::addResources(Re |
331 |
- // only add upnp:AlbumArtURI if we have an AA, skip the resource |
332 |
- if ((i > 0) && ((item->getResource(i)->getHandlerType() == CH_ID3) || |
333 |
- (item->getResource(i)->getHandlerType() == CH_MP4) || |
334 |
-+ (item->getResource(i)->getHandlerType() == CH_FLAC) || |
335 |
- (item->getResource(i)->getHandlerType() == CH_EXTURL))) |
336 |
- { |
337 |
- String rct; |
338 |
-diff -urpN a/src/config_manager.cc b/src/config_manager.cc |
339 |
---- a/src/config_manager.cc 2010-03-26 01:58:11.000000000 +1100 |
340 |
-+++ b/src/config_manager.cc 2013-12-16 10:26:57.220886235 +1100 |
341 |
-@@ -624,6 +624,10 @@ String ConfigManager::createDefaultConfi |
342 |
- _(CONTENT_TYPE_OGG))); |
343 |
- mtcontent->appendElementChild(treat_as(_("audio/x-flac"), |
344 |
- _(CONTENT_TYPE_FLAC))); |
345 |
-+ mtcontent->appendElementChild(treat_as(_("audio/x-ms-wma"), |
346 |
-+ _(CONTENT_TYPE_WMA))); |
347 |
-+ mtcontent->appendElementChild(treat_as(_("audio/x-wavpack"), |
348 |
-+ _(CONTENT_TYPE_WAVPACK))); |
349 |
- mtcontent->appendElementChild(treat_as(_("image/jpeg"), |
350 |
- _(CONTENT_TYPE_JPG))); |
351 |
- mtcontent->appendElementChild(treat_as(_("audio/x-mpegurl"), |
352 |
-diff -urpN a/src/metadata/flac_handler.cc b/src/metadata/flac_handler.cc |
353 |
---- a/src/metadata/flac_handler.cc 1970-01-01 10:00:00.000000000 +1000 |
354 |
-+++ b/src/metadata/flac_handler.cc 2013-12-16 10:30:19.955604387 +1100 |
355 |
-@@ -0,0 +1,204 @@ |
356 |
-+/*MT* |
357 |
-+ |
358 |
-+ MediaTomb - http://www.mediatomb.cc/ |
359 |
-+ |
360 |
-+ flac_handler.cc - this file is part of MediaTomb. |
361 |
-+ |
362 |
-+ Copyright (C) 2005 Gena Batyan <bgeradz@×××××××××.cc>, |
363 |
-+ Sergey 'Jin' Bostandzhyan <jin@×××××××××.cc> |
364 |
-+ |
365 |
-+ Copyright (C) 2006-2009 Gena Batyan <bgeradz@×××××××××.cc>, |
366 |
-+ Sergey 'Jin' Bostandzhyan <jin@×××××××××.cc>, |
367 |
-+ Leonhard Wimmer <leo@×××××××××.cc> |
368 |
-+ |
369 |
-+ MediaTomb is free software; you can redistribute it and/or modify |
370 |
-+ it under the terms of the GNU General Public License version 2 |
371 |
-+ as published by the Free Software Foundation. |
372 |
-+ |
373 |
-+ MediaTomb is distributed in the hope that it will be useful, |
374 |
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of |
375 |
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
376 |
-+ GNU General Public License for more details. |
377 |
-+ |
378 |
-+ You should have received a copy of the GNU General Public License |
379 |
-+ version 2 along with MediaTomb; if not, write to the Free Software |
380 |
-+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
381 |
-+ |
382 |
-+ # $Id$ |
383 |
-+*/ |
384 |
-+ |
385 |
-+/// \file flac_handler.cc |
386 |
-+/// \brief Implementeation of the FlacHandler class. |
387 |
-+ |
388 |
-+#ifdef HAVE_CONFIG_H |
389 |
-+ #include "autoconfig.h" |
390 |
-+#endif |
391 |
-+ |
392 |
-+#ifdef HAVE_FLAC |
393 |
-+ |
394 |
-+#include <FLAC/all.h> |
395 |
-+ |
396 |
-+#include "flac_handler.h" |
397 |
-+#include "string_converter.h" |
398 |
-+#include "config_manager.h" |
399 |
-+#include "common.h" |
400 |
-+#include "tools.h" |
401 |
-+#include "mem_io_handler.h" |
402 |
-+ |
403 |
-+#include "content_manager.h" |
404 |
-+ |
405 |
-+using namespace zmm; |
406 |
-+ |
407 |
-+FlacHandler::FlacHandler() : MetadataHandler() |
408 |
-+{ |
409 |
-+} |
410 |
-+ |
411 |
-+static void addField(metadata_fields_t field, const FLAC__StreamMetadata* tags, Ref<CdsItem> item) |
412 |
-+{ |
413 |
-+ String value; |
414 |
-+ int i; |
415 |
-+ |
416 |
-+ Ref<StringConverter> sc = StringConverter::i2i(); // sure is sure |
417 |
-+ |
418 |
-+ switch (field) |
419 |
-+ { |
420 |
-+ case M_TITLE: |
421 |
-+ i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "TITLE"); |
422 |
-+ break; |
423 |
-+ case M_ARTIST: |
424 |
-+ i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "ARTIST"); |
425 |
-+ break; |
426 |
-+ case M_ALBUM: |
427 |
-+ i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "ALBUM"); |
428 |
-+ break; |
429 |
-+ case M_DATE: |
430 |
-+ i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "DATE"); |
431 |
-+ break; |
432 |
-+ case M_GENRE: |
433 |
-+ i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "GENRE"); |
434 |
-+ break; |
435 |
-+ case M_DESCRIPTION: |
436 |
-+ i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "DESCRIPTION"); |
437 |
-+ break; |
438 |
-+ case M_TRACKNUMBER: |
439 |
-+ i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, "TRACKNUMBER"); |
440 |
-+ break; |
441 |
-+ default: |
442 |
-+ return; |
443 |
-+ } |
444 |
-+ |
445 |
-+ if( 0 <= i ) |
446 |
-+ value = strchr((const char *)tags->data.vorbis_comment.comments[i].entry, '=') + 1; |
447 |
-+ else |
448 |
-+ return; |
449 |
-+ |
450 |
-+ value = trim_string(value); |
451 |
-+ |
452 |
-+ if (string_ok(value)) |
453 |
-+ { |
454 |
-+ item->setMetadata(MT_KEYS[field].upnp, sc->convert(value)); |
455 |
-+ log_debug("Setting metadata on item: %d, %s\n", field, sc->convert(value).c_str()); |
456 |
-+ } |
457 |
-+} |
458 |
-+ |
459 |
-+void FlacHandler::fillMetadata(Ref<CdsItem> item) |
460 |
-+{ |
461 |
-+ FLAC__StreamMetadata* tags = NULL; |
462 |
-+ FLAC__StreamMetadata streaminfo; |
463 |
-+ Ref<StringConverter> sc = StringConverter::i2i(); // sure is sure |
464 |
-+ |
465 |
-+ if( !FLAC__metadata_get_tags(item->getLocation().c_str(), &tags) ) |
466 |
-+ return; |
467 |
-+ |
468 |
-+ if( FLAC__METADATA_TYPE_VORBIS_COMMENT == tags->type ) |
469 |
-+ { |
470 |
-+ for (int i = 0; i < M_MAX; i++) |
471 |
-+ addField((metadata_fields_t) i, tags, item); |
472 |
-+ } |
473 |
-+ |
474 |
-+ FLAC__metadata_object_delete(tags); |
475 |
-+ tags = NULL; |
476 |
-+ |
477 |
-+ if( !FLAC__metadata_get_streaminfo(item->getLocation().c_str(), &streaminfo) ) |
478 |
-+ return; |
479 |
-+ |
480 |
-+ if( FLAC__METADATA_TYPE_STREAMINFO == streaminfo.type ) |
481 |
-+ { |
482 |
-+ // note: UPnP requires bytes/second |
483 |
-+ item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_BITRATE), String::from((unsigned)((streaminfo.data.stream_info.bits_per_sample * streaminfo.data.stream_info.sample_rate) / 8))); |
484 |
-+ // note: UPnP requires HMS |
485 |
-+ item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_DURATION), secondsToHMS((unsigned)(streaminfo.data.stream_info.total_samples / streaminfo.data.stream_info.sample_rate))); |
486 |
-+ item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_SAMPLEFREQUENCY), String::from(streaminfo.data.stream_info.sample_rate)); |
487 |
-+ item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_NRAUDIOCHANNELS), String::from(streaminfo.data.stream_info.channels)); |
488 |
-+ } |
489 |
-+ |
490 |
-+ if( !FLAC__metadata_get_picture(item->getLocation().c_str(), |
491 |
-+ &tags, |
492 |
-+ FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER, |
493 |
-+ NULL, |
494 |
-+ NULL, |
495 |
-+ (unsigned)-1, |
496 |
-+ (unsigned)-1, |
497 |
-+ (unsigned)-1, |
498 |
-+ (unsigned)-1 ) ) |
499 |
-+ return; |
500 |
-+ |
501 |
-+ if( FLAC__METADATA_TYPE_PICTURE == tags->type ) |
502 |
-+ { |
503 |
-+ String art_mimetype = tags->data.picture.mime_type; |
504 |
-+ log_debug("Mime type : %s\n", sc->convert(art_mimetype).c_str()); |
505 |
-+ |
506 |
-+ // saw that simply "PNG" was used with some mp3's, so mimetype setting |
507 |
-+ // was probably invalid |
508 |
-+ if (!string_ok(art_mimetype) || (art_mimetype.index('/') == -1)) |
509 |
-+ { |
510 |
-+#ifdef HAVE_MAGIC |
511 |
-+ art_mimetype = ContentManager::getInstance()->getMimeTypeFromBuffer((void *)tags->data.picture.data, tags->data.picture.data_length); |
512 |
-+ if (!string_ok(art_mimetype)) |
513 |
-+#endif |
514 |
-+ art_mimetype = _(MIMETYPE_DEFAULT); |
515 |
-+ |
516 |
-+ log_debug("Mime type via magic: %s\n", sc->convert(art_mimetype).c_str()); |
517 |
-+ } |
518 |
-+ |
519 |
-+ // if we could not determine the mimetype, then there is no |
520 |
-+ // point to add the resource - it's probably garbage |
521 |
-+ if (art_mimetype != _(MIMETYPE_DEFAULT)) |
522 |
-+ { |
523 |
-+ Ref<CdsResource> resource(new CdsResource(CH_FLAC)); |
524 |
-+ resource->addAttribute(MetadataHandler::getResAttrName(R_PROTOCOLINFO), renderProtocolInfo(art_mimetype)); |
525 |
-+ resource->addParameter(_(RESOURCE_CONTENT_TYPE), _(ID3_ALBUM_ART)); |
526 |
-+ item->addResource(resource); |
527 |
-+ } |
528 |
-+ } |
529 |
-+ |
530 |
-+ FLAC__metadata_object_delete(tags); |
531 |
-+} |
532 |
-+ |
533 |
-+Ref<IOHandler> FlacHandler::serveContent(Ref<CdsItem> item, int resNum, off_t *data_size) |
534 |
-+{ |
535 |
-+ FLAC__StreamMetadata* picture = NULL; |
536 |
-+ |
537 |
-+ if( !FLAC__metadata_get_picture(item->getLocation().c_str(), |
538 |
-+ &picture, |
539 |
-+ FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER, |
540 |
-+ NULL, |
541 |
-+ NULL, |
542 |
-+ (unsigned)-1, |
543 |
-+ (unsigned)-1, |
544 |
-+ (unsigned)-1, |
545 |
-+ (unsigned)-1 ) ) |
546 |
-+ throw _Exception(_("FlacHandler: could not exctract cover from: ") + item->getLocation()); |
547 |
-+ |
548 |
-+ if( FLAC__METADATA_TYPE_PICTURE != picture->type ) |
549 |
-+ throw _Exception(_("TagHandler: resource has no album information")); |
550 |
-+ |
551 |
-+ Ref<IOHandler> h(new MemIOHandler((void *)picture->data.picture.data, picture->data.picture.data_length)); |
552 |
-+ *data_size = picture->data.picture.data_length; |
553 |
-+ |
554 |
-+ FLAC__metadata_object_delete(picture); |
555 |
-+ |
556 |
-+ return h; |
557 |
-+} |
558 |
-+ |
559 |
-+#endif // HAVE_FLAC |
560 |
-diff -urpN a/src/metadata/flac_handler.h b/src/metadata/flac_handler.h |
561 |
---- a/src/metadata/flac_handler.h 1970-01-01 10:00:00.000000000 +1000 |
562 |
-+++ b/src/metadata/flac_handler.h 2013-12-16 10:31:24.061822827 +1100 |
563 |
-@@ -0,0 +1,47 @@ |
564 |
-+/*MT* |
565 |
-+ |
566 |
-+ MediaTomb - http://www.mediatomb.cc/ |
567 |
-+ |
568 |
-+ flac_handler.h - this file is part of MediaTomb. |
569 |
-+ |
570 |
-+ Copyright (C) 2005 Gena Batyan <bgeradz@×××××××××.cc>, |
571 |
-+ Sergey 'Jin' Bostandzhyan <jin@×××××××××.cc> |
572 |
-+ |
573 |
-+ Copyright (C) 2006-2009 Gena Batyan <bgeradz@×××××××××.cc>, |
574 |
-+ Sergey 'Jin' Bostandzhyan <jin@×××××××××.cc>, |
575 |
-+ Leonhard Wimmer <leo@×××××××××.cc> |
576 |
-+ |
577 |
-+ MediaTomb is free software; you can redistribute it and/or modify |
578 |
-+ it under the terms of the GNU General Public License version 2 |
579 |
-+ as published by the Free Software Foundation. |
580 |
-+ |
581 |
-+ MediaTomb is distributed in the hope that it will be useful, |
582 |
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of |
583 |
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
584 |
-+ GNU General Public License for more details. |
585 |
-+ |
586 |
-+ You should have received a copy of the GNU General Public License |
587 |
-+ version 2 along with MediaTomb; if not, write to the Free Software |
588 |
-+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
589 |
-+ |
590 |
-+ # $Id$ |
591 |
-+*/ |
592 |
-+ |
593 |
-+/// \file flac_handler.h |
594 |
-+/// \brief Definition of the FlacHandler class. |
595 |
-+ |
596 |
-+#ifndef __METADATA_FLAC_H__ |
597 |
-+#define __METADATA_FLAC_H__ |
598 |
-+ |
599 |
-+#include "metadata_handler.h" |
600 |
-+ |
601 |
-+/// \brief This class is responsible for reading FLAC metadata |
602 |
-+class FlacHandler : public MetadataHandler |
603 |
-+{ |
604 |
-+public: |
605 |
-+ FlacHandler(); |
606 |
-+ virtual void fillMetadata(zmm::Ref<CdsItem> item); |
607 |
-+ virtual zmm::Ref<IOHandler> serveContent(zmm::Ref<CdsItem> item, int resNum, off_t *data_size); |
608 |
-+}; |
609 |
-+ |
610 |
-+#endif // __METADATA_FLAC_H__ |
611 |
-diff -urpN a/src/metadata_handler.cc b/src/metadata_handler.cc |
612 |
---- a/src/metadata_handler.cc 2010-03-26 01:58:11.000000000 +1100 |
613 |
-+++ b/src/metadata_handler.cc 2013-12-16 10:35:48.783540865 +1100 |
614 |
-@@ -51,6 +51,10 @@ |
615 |
- #endif // HAVE_ID3LIB |
616 |
- #endif // HAVE_TAGLIB |
617 |
- |
618 |
-+#ifdef HAVE_FLAC |
619 |
-+#include "metadata/flac_handler.h" |
620 |
-+#endif |
621 |
-+ |
622 |
- #ifdef HAVE_LIBMP4V2 |
623 |
- #include "metadata/libmp4v2_handler.h" |
624 |
- #endif |
625 |
-@@ -140,7 +144,8 @@ void MetadataHandler::setMetadata(Ref<Cd |
626 |
- if ((content_type == CONTENT_TYPE_MP3) || |
627 |
- ((content_type == CONTENT_TYPE_OGG) && |
628 |
- (!item->getFlag(OBJECT_FLAG_OGG_THEORA))) || |
629 |
-- (content_type == CONTENT_TYPE_FLAC)) |
630 |
-+ (content_type == CONTENT_TYPE_WMA) || |
631 |
-+ (content_type == CONTENT_TYPE_WAVPACK)) |
632 |
- { |
633 |
- handler = Ref<MetadataHandler>(new TagHandler()); |
634 |
- break; |
635 |
-@@ -155,7 +160,13 @@ void MetadataHandler::setMetadata(Ref<Cd |
636 |
- #endif // HAVE_ID3LIB |
637 |
- #endif // HAVE_TAGLIB |
638 |
- |
639 |
-- |
640 |
-+#ifdef HAVE_FLAC |
641 |
-+ if (content_type == CONTENT_TYPE_FLAC) |
642 |
-+ { |
643 |
-+ handler = Ref<MetadataHandler>(new FlacHandler()); |
644 |
-+ break; |
645 |
-+ } |
646 |
-+#endif |
647 |
- |
648 |
- #ifdef HAVE_EXIV2 |
649 |
- /* |
650 |
-@@ -277,6 +288,10 @@ Ref<MetadataHandler> MetadataHandler::cr |
651 |
- case CH_FFTH: |
652 |
- return Ref<MetadataHandler>(new FfmpegHandler()); |
653 |
- #endif |
654 |
-+#ifdef HAVE_FLAC |
655 |
-+ case CH_FLAC: |
656 |
-+ return Ref<MetadataHandler>(new FlacHandler()); |
657 |
-+#endif |
658 |
- default: |
659 |
- throw _Exception(_("unknown content handler ID: ") + handlerType); |
660 |
- } |
661 |
-diff -urpN a/src/metadata_handler.h b/src/metadata_handler.h |
662 |
---- a/src/metadata_handler.h 2010-03-26 01:58:11.000000000 +1100 |
663 |
-+++ b/src/metadata_handler.h 2013-12-16 10:52:23.234353526 +1100 |
664 |
-@@ -45,10 +45,13 @@ |
665 |
- #define CH_EXTURL 4 |
666 |
- #define CH_MP4 5 |
667 |
- #define CH_FFTH 6 |
668 |
-+#define CH_FLAC 7 |
669 |
- |
670 |
- #define CONTENT_TYPE_MP3 "mp3" |
671 |
- #define CONTENT_TYPE_OGG "ogg" |
672 |
- #define CONTENT_TYPE_FLAC "flac" |
673 |
-+#define CONTENT_TYPE_WMA "wma" |
674 |
-+#define CONTENT_TYPE_WAVPACK "wv" |
675 |
- #define CONTENT_TYPE_JPG "jpg" |
676 |
- #define CONTENT_TYPE_PLAYLIST "playlist" |
677 |
- #define CONTENT_TYPE_MP4 "mp4" |
678 |
|
679 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1-inotify-hard-links.patch b/net-misc/mediatomb/files/mediatomb-0.12.1-inotify-hard-links.patch |
680 |
deleted file mode 100644 |
681 |
index af9a887befe..00000000000 |
682 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1-inotify-hard-links.patch |
683 |
+++ /dev/null |
684 |
@@ -1,34 +0,0 @@ |
685 |
-make sure new hard links get processed like new files by handling |
686 |
-the IN_CREATE flag properly |
687 |
- |
688 |
-patch by Mike Frysinger |
689 |
- |
690 |
---- a/src/autoscan_inotify.cc |
691 |
-+++ b/src/autoscan_inotify.cc |
692 |
-@@ -281,7 +284,7 @@ |
693 |
- } |
694 |
- } |
695 |
- |
696 |
-- if (adir != nil && mask & (IN_DELETE | IN_DELETE_SELF | IN_MOVE_SELF | IN_CLOSE_WRITE | IN_MOVED_FROM | IN_MOVED_TO | IN_UNMOUNT)) |
697 |
-+ if (adir != nil && mask & (IN_DELETE | IN_DELETE_SELF | IN_MOVE_SELF | IN_CLOSE_WRITE | IN_MOVED_FROM | IN_MOVED_TO | IN_UNMOUNT | IN_CREATE)) |
698 |
- { |
699 |
- String fullPath; |
700 |
- if (mask & IN_ISDIR) |
701 |
-@@ -289,7 +292,7 @@ |
702 |
- else |
703 |
- fullPath = path; |
704 |
- |
705 |
-- if (! (mask & IN_MOVED_TO)) |
706 |
-+ if (! (mask & (IN_MOVED_TO | IN_CREATE))) |
707 |
- { |
708 |
- log_debug("deleting %s\n", fullPath.c_str()); |
709 |
- |
710 |
-@@ -312,7 +315,7 @@ |
711 |
- if (objectID != INVALID_OBJECT_ID) |
712 |
- cm->removeObject(objectID); |
713 |
- } |
714 |
-- if (mask & (IN_CLOSE_WRITE | IN_MOVED_TO)) |
715 |
-+ if (mask & (IN_CLOSE_WRITE | IN_MOVED_TO | IN_CREATE)) |
716 |
- { |
717 |
- log_debug("adding %s\n", path.c_str()); |
718 |
- // path, recursive, async, hidden, low priority, cancellable |
719 |
|
720 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1-libextractor.patch b/net-misc/mediatomb/files/mediatomb-0.12.1-libextractor.patch |
721 |
deleted file mode 100644 |
722 |
index e46aca9c487..00000000000 |
723 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1-libextractor.patch |
724 |
+++ /dev/null |
725 |
@@ -1,675 +0,0 @@ |
726 |
-http://bugs.gentoo.org/435394 |
727 |
- |
728 |
-port to libextractor-0.6.x |
729 |
- |
730 |
-patch by Mike Frysinger <vapier@g.o> |
731 |
- |
732 |
---- a/configure.ac |
733 |
-+++ b/configure.ac |
734 |
-@@ -1631,7 +1631,7 @@ MT_CHECK_OPTIONAL_PACKAGE([lastfmlib], [disable], |
735 |
- ######## extractor |
736 |
- |
737 |
- if test "x$LIBEXTRACTOR_OPTION_ENABLED" = xyes; then |
738 |
-- MT_CHECK_PACKAGE([libextractor], [extractor], [extractor], [EXTRACTOR_getKeywords]) |
739 |
-+ MT_CHECK_PACKAGE([libextractor], [extractor], [extractor], [EXTRACTOR_extract]) |
740 |
- fi |
741 |
- |
742 |
- if test "x$LIBEXTRACTOR_STATUS" = xyes; then |
743 |
---- a/src/metadata/extractor_handler.cc |
744 |
-+++ b/src/metadata/extractor_handler.cc |
745 |
-@@ -55,322 +55,344 @@ ExtractorHandler::ExtractorHandler() : MetadataHandler() |
746 |
- { |
747 |
- } |
748 |
- |
749 |
--static EXTRACTOR_KeywordType getTagFromString(String tag) |
750 |
-+static EXTRACTOR_MetaType getTagFromString(String tag) |
751 |
- { |
752 |
-- if (tag == "EXTRACTOR_UNKNOWN") |
753 |
-- return EXTRACTOR_UNKNOWN; |
754 |
-- if (tag == "EXTRACTOR_FILENAME") |
755 |
-- return EXTRACTOR_FILENAME; |
756 |
-- if (tag == "EXTRACTOR_MIMETYPE") |
757 |
-- return EXTRACTOR_MIMETYPE; |
758 |
-- if (tag == "EXTRACTOR_TITLE") |
759 |
-- return EXTRACTOR_TITLE; |
760 |
-- if (tag == "EXTRACTOR_AUTHOR") |
761 |
-- return EXTRACTOR_AUTHOR; |
762 |
-- if (tag == "EXTRACTOR_ARTIST") |
763 |
-- return EXTRACTOR_ARTIST; |
764 |
-- if (tag == "EXTRACTOR_DESCRIPTION") |
765 |
-- return EXTRACTOR_DESCRIPTION; |
766 |
-- if (tag == "EXTRACTOR_COMMENT") |
767 |
-- return EXTRACTOR_COMMENT; |
768 |
-- if (tag == "EXTRACTOR_DATE") |
769 |
-- return EXTRACTOR_DATE; |
770 |
-- if (tag == "EXTRACTOR_PUBLISHER") |
771 |
-- return EXTRACTOR_PUBLISHER; |
772 |
-- if (tag == "EXTRACTOR_LANGUAGE") |
773 |
-- return EXTRACTOR_LANGUAGE; |
774 |
-- if (tag == "EXTRACTOR_ALBUM") |
775 |
-- return EXTRACTOR_ALBUM; |
776 |
-- if (tag == "EXTRACTOR_GENRE") |
777 |
-- return EXTRACTOR_GENRE; |
778 |
-- if (tag == "EXTRACTOR_LOCATION") |
779 |
-- return EXTRACTOR_LOCATION; |
780 |
-- if (tag == "EXTRACTOR_VERSIONNUMBER") |
781 |
-- return EXTRACTOR_VERSIONNUMBER; |
782 |
-- if (tag == "EXTRACTOR_ORGANIZATION") |
783 |
-- return EXTRACTOR_ORGANIZATION; |
784 |
-- if (tag == "EXTRACTOR_COPYRIGHT") |
785 |
-- return EXTRACTOR_COPYRIGHT; |
786 |
-- if (tag == "EXTRACTOR_SUBJECT") |
787 |
-- return EXTRACTOR_SUBJECT; |
788 |
-- if (tag == "EXTRACTOR_KEYWORDS") |
789 |
-- return EXTRACTOR_KEYWORDS; |
790 |
-- if (tag == "EXTRACTOR_CONTRIBUTOR") |
791 |
-- return EXTRACTOR_CONTRIBUTOR; |
792 |
-- if (tag == "EXTRACTOR_RESOURCE_TYPE") |
793 |
-- return EXTRACTOR_RESOURCE_TYPE; |
794 |
-- if (tag == "EXTRACTOR_FORMAT") |
795 |
-- return EXTRACTOR_FORMAT; |
796 |
-- if (tag == "EXTRACTOR_RESOURCE_IDENTIFIER") |
797 |
-- return EXTRACTOR_RESOURCE_IDENTIFIER; |
798 |
-- if (tag == "EXTRACTOR_SOURCE") |
799 |
-- return EXTRACTOR_SOURCE; |
800 |
-- if (tag == "EXTRACTOR_RELATION") |
801 |
-- return EXTRACTOR_RELATION; |
802 |
-- if (tag == "EXTRACTOR_COVERAGE") |
803 |
-- return EXTRACTOR_COVERAGE; |
804 |
-- if (tag == "EXTRACTOR_SOFTWARE") |
805 |
-- return EXTRACTOR_SOFTWARE; |
806 |
-- if (tag == "EXTRACTOR_DISCLAIMER") |
807 |
-- return EXTRACTOR_DISCLAIMER; |
808 |
-- if (tag == "EXTRACTOR_WARNING") |
809 |
-- return EXTRACTOR_WARNING; |
810 |
-- if (tag == "EXTRACTOR_TRANSLATED") |
811 |
-- return EXTRACTOR_TRANSLATED; |
812 |
-- if (tag == "EXTRACTOR_CREATION_DATE") |
813 |
-- return EXTRACTOR_CREATION_DATE; |
814 |
-- if (tag == "EXTRACTOR_MODIFICATION_DATE") |
815 |
-- return EXTRACTOR_MODIFICATION_DATE; |
816 |
-- if (tag == "EXTRACTOR_CREATOR") |
817 |
-- return EXTRACTOR_CREATOR; |
818 |
-- if (tag == "EXTRACTOR_PRODUCER") |
819 |
-- return EXTRACTOR_PRODUCER; |
820 |
-- if (tag == "EXTRACTOR_PAGE_COUNT") |
821 |
-- return EXTRACTOR_PAGE_COUNT; |
822 |
-- if (tag == "EXTRACTOR_PAGE_ORIENTATION") |
823 |
-- return EXTRACTOR_PAGE_ORIENTATION; |
824 |
-- if (tag == "EXTRACTOR_PAPER_SIZE") |
825 |
-- return EXTRACTOR_PAPER_SIZE; |
826 |
-- if (tag == "EXTRACTOR_USED_FONTS") |
827 |
-- return EXTRACTOR_USED_FONTS; |
828 |
-- if (tag == "EXTRACTOR_PAGE_ORDER") |
829 |
-- return EXTRACTOR_PAGE_ORDER; |
830 |
-- if (tag == "EXTRACTOR_CREATED_FOR") |
831 |
-- return EXTRACTOR_CREATED_FOR; |
832 |
-- if (tag == "EXTRACTOR_MAGNIFICATION") |
833 |
-- return EXTRACTOR_MAGNIFICATION; |
834 |
-- if (tag == "EXTRACTOR_RELEASE") |
835 |
-- return EXTRACTOR_RELEASE; |
836 |
-- if (tag == "EXTRACTOR_GROUP") |
837 |
-- return EXTRACTOR_GROUP; |
838 |
-- if (tag == "EXTRACTOR_SIZE") |
839 |
-- return EXTRACTOR_SIZE; |
840 |
-- if (tag == "EXTRACTOR_SUMMARY") |
841 |
-- return EXTRACTOR_SUMMARY; |
842 |
-- if (tag == "EXTRACTOR_PACKAGER") |
843 |
-- return EXTRACTOR_PACKAGER; |
844 |
-- if (tag == "EXTRACTOR_VENDOR") |
845 |
-- return EXTRACTOR_VENDOR; |
846 |
-- if (tag == "EXTRACTOR_LICENSE") |
847 |
-- return EXTRACTOR_LICENSE; |
848 |
-- if (tag == "EXTRACTOR_DISTRIBUTION") |
849 |
-- return EXTRACTOR_DISTRIBUTION; |
850 |
-- if (tag == "EXTRACTOR_BUILDHOST") |
851 |
-- return EXTRACTOR_BUILDHOST; |
852 |
-- if (tag == "EXTRACTOR_OS") |
853 |
-- return EXTRACTOR_OS; |
854 |
-- if (tag == "EXTRACTOR_DEPENDENCY") |
855 |
-- return EXTRACTOR_DEPENDENCY; |
856 |
-- if (tag == "EXTRACTOR_HASH_MD4") |
857 |
-- return EXTRACTOR_HASH_MD4; |
858 |
-- if (tag == "EXTRACTOR_HASH_MD5") |
859 |
-- return EXTRACTOR_HASH_MD5; |
860 |
-- if (tag == "EXTRACTOR_HASH_SHA0") |
861 |
-- return EXTRACTOR_HASH_SHA0; |
862 |
-- if (tag == "EXTRACTOR_HASH_SHA1") |
863 |
-- return EXTRACTOR_HASH_SHA1; |
864 |
-- if (tag == "EXTRACTOR_HASH_RMD160") |
865 |
-- return EXTRACTOR_HASH_RMD160; |
866 |
-- if (tag == "EXTRACTOR_RESOLUTION") |
867 |
-- return EXTRACTOR_RESOLUTION; |
868 |
-- if (tag == "EXTRACTOR_CATEGORY") |
869 |
-- return EXTRACTOR_CATEGORY; |
870 |
-- if (tag == "EXTRACTOR_BOOKTITLE") |
871 |
-- return EXTRACTOR_BOOKTITLE; |
872 |
-- if (tag == "EXTRACTOR_PRIORITY") |
873 |
-- return EXTRACTOR_PRIORITY; |
874 |
-- if (tag == "EXTRACTOR_CONFLICTS") |
875 |
-- return EXTRACTOR_CONFLICTS; |
876 |
-- if (tag == "EXTRACTOR_REPLACES") |
877 |
-- return EXTRACTOR_REPLACES; |
878 |
-- if (tag == "EXTRACTOR_PROVIDES") |
879 |
-- return EXTRACTOR_PROVIDES; |
880 |
-- if (tag == "EXTRACTOR_CONDUCTOR") |
881 |
-- return EXTRACTOR_CONDUCTOR; |
882 |
-- if (tag == "EXTRACTOR_INTERPRET") |
883 |
-- return EXTRACTOR_INTERPRET; |
884 |
-- if (tag == "EXTRACTOR_OWNER") |
885 |
-- return EXTRACTOR_OWNER; |
886 |
-- if (tag == "EXTRACTOR_LYRICS") |
887 |
-- return EXTRACTOR_LYRICS; |
888 |
-- if (tag == "EXTRACTOR_MEDIA_TYPE") |
889 |
-- return EXTRACTOR_MEDIA_TYPE; |
890 |
-- if (tag == "EXTRACTOR_CONTACT") |
891 |
-- return EXTRACTOR_CONTACT; |
892 |
-- if (tag == "EXTRACTOR_THUMBNAIL_DATA") |
893 |
-- return EXTRACTOR_THUMBNAIL_DATA; |
894 |
-- |
895 |
--#ifdef EXTRACTOR_GE_0_5_2 |
896 |
-- if (tag == "EXTRACTOR_PUBLICATION_DATE") |
897 |
-- return EXTRACTOR_PUBLICATION_DATE; |
898 |
-- if (tag == "EXTRACTOR_CAMERA_MAKE") |
899 |
-- return EXTRACTOR_CAMERA_MAKE; |
900 |
-- if (tag == "EXTRACTOR_CAMERA_MODEL") |
901 |
-- return EXTRACTOR_CAMERA_MODEL; |
902 |
-- if (tag == "EXTRACTOR_EXPOSURE") |
903 |
-- return EXTRACTOR_EXPOSURE; |
904 |
-- if (tag == "EXTRACTOR_APERTURE") |
905 |
-- return EXTRACTOR_APERTURE; |
906 |
-- if (tag == "EXTRACTOR_EXPOSURE_BIAS") |
907 |
-- return EXTRACTOR_EXPOSURE_BIAS; |
908 |
-- if (tag == "EXTRACTOR_FLASH") |
909 |
-- return EXTRACTOR_FLASH; |
910 |
-- if (tag == "EXTRACTOR_FLASH_BIAS") |
911 |
-- return EXTRACTOR_FLASH_BIAS; |
912 |
-- if (tag == "EXTRACTOR_FOCAL_LENGTH") |
913 |
-- return EXTRACTOR_FOCAL_LENGTH; |
914 |
-- if (tag == "EXTRACTOR_FOCAL_LENGTH_35MM") |
915 |
-- return EXTRACTOR_FOCAL_LENGTH_35MM; |
916 |
-- if (tag == "EXTRACTOR_ISO_SPEED") |
917 |
-- return EXTRACTOR_ISO_SPEED; |
918 |
-- if (tag == "EXTRACTOR_EXPOSURE_MODE") |
919 |
-- return EXTRACTOR_EXPOSURE_MODE; |
920 |
-- if (tag == "EXTRACTOR_METERING_MODE") |
921 |
-- return EXTRACTOR_METERING_MODE; |
922 |
-- if (tag == "EXTRACTOR_MACRO_MODE") |
923 |
-- return EXTRACTOR_MACRO_MODE; |
924 |
-- if (tag == "EXTRACTOR_IMAGE_QUALITY") |
925 |
-- return EXTRACTOR_IMAGE_QUALITY; |
926 |
-- if (tag == "EXTRACTOR_WHITE_BALANCE") |
927 |
-- return EXTRACTOR_WHITE_BALANCE; |
928 |
-- if (tag == "EXTRACTOR_ORIENTATION") |
929 |
-- return EXTRACTOR_ORIENTATION; |
930 |
--#endif // EXTRACTOR_GE_0_5_2 |
931 |
-+#define T(x) [EXTRACTOR_METATYPE_##x] = "EXTRACTOR_METATYPE_"#x, |
932 |
-+ /* XXX: should convert to EXTRACTOR_metatype_to_string() somehow */ |
933 |
-+ const char *types[] = |
934 |
-+ { |
935 |
-+ T(RESERVED) |
936 |
-+ T(MIMETYPE) |
937 |
-+ T(FILENAME) |
938 |
-+ T(COMMENT) |
939 |
-+ |
940 |
-+ T(TITLE) |
941 |
-+ T(BOOK_TITLE) |
942 |
-+ T(BOOK_EDITION) |
943 |
-+ T(BOOK_CHAPTER_NUMBER) |
944 |
-+ T(JOURNAL_NAME) |
945 |
-+ T(JOURNAL_VOLUME) |
946 |
-+ T(JOURNAL_NUMBER) |
947 |
-+ T(PAGE_COUNT) |
948 |
-+ T(PAGE_RANGE) |
949 |
-+ T(AUTHOR_NAME) |
950 |
-+ T(AUTHOR_EMAIL) |
951 |
-+ T(AUTHOR_INSTITUTION) |
952 |
-+ T(PUBLISHER) |
953 |
-+ T(PUBLISHER_ADDRESS) |
954 |
-+ T(PUBLISHER_INSTITUTION) |
955 |
-+ T(PUBLISHER_SERIES) |
956 |
-+ T(PUBLICATION_TYPE) |
957 |
-+ T(PUBLICATION_YEAR) |
958 |
-+ T(PUBLICATION_MONTH) |
959 |
-+ T(PUBLICATION_DAY) |
960 |
-+ T(PUBLICATION_DATE) |
961 |
-+ T(BIBTEX_EPRINT) |
962 |
-+ T(BIBTEX_ENTRY_TYPE) |
963 |
-+ T(LANGUAGE) |
964 |
-+ T(CREATION_TIME) |
965 |
-+ T(URL) |
966 |
-+ |
967 |
-+ T(URI) |
968 |
-+ T(ISRC) |
969 |
-+ T(HASH_MD4) |
970 |
-+ T(HASH_MD5) |
971 |
-+ T(HASH_SHA0) |
972 |
-+ T(HASH_SHA1) |
973 |
-+ T(HASH_RMD160) |
974 |
-+ |
975 |
-+ T(GPS_LATITUDE_REF) |
976 |
-+ T(GPS_LATITUDE) |
977 |
-+ T(GPS_LONGITUDE_REF) |
978 |
-+ T(GPS_LONGITUDE) |
979 |
-+ T(LOCATION_CITY) |
980 |
-+ T(LOCATION_SUBLOCATION) |
981 |
-+ T(LOCATION_COUNTRY) |
982 |
-+ T(LOCATION_COUNTRY_CODE) |
983 |
-+ |
984 |
-+ T(UNKNOWN) |
985 |
-+ T(DESCRIPTION) |
986 |
-+ T(COPYRIGHT) |
987 |
-+ T(RIGHTS) |
988 |
-+ T(KEYWORDS) |
989 |
-+ T(ABSTRACT) |
990 |
-+ T(SUMMARY) |
991 |
-+ T(SUBJECT) |
992 |
-+ T(CREATOR) |
993 |
-+ T(FORMAT) |
994 |
-+ T(FORMAT_VERSION) |
995 |
-+ |
996 |
-+ T(CREATED_BY_SOFTWARE) |
997 |
-+ T(UNKNOWN_DATE) |
998 |
-+ T(CREATION_DATE) |
999 |
-+ T(MODIFICATION_DATE) |
1000 |
-+ T(LAST_PRINTED) |
1001 |
-+ T(LAST_SAVED_BY) |
1002 |
-+ T(TOTAL_EDITING_TIME) |
1003 |
-+ T(EDITING_CYCLES) |
1004 |
-+ T(MODIFIED_BY_SOFTWARE) |
1005 |
-+ T(REVISION_HISTORY) |
1006 |
-+ |
1007 |
-+ T(EMBEDDED_FILE_SIZE) |
1008 |
-+ T(FINDER_FILE_TYPE) |
1009 |
-+ T(FINDER_FILE_CREATOR) |
1010 |
-+ |
1011 |
-+ T(PACKAGE_NAME) |
1012 |
-+ T(PACKAGE_VERSION) |
1013 |
-+ T(SECTION) |
1014 |
-+ T(UPLOAD_PRIORITY) |
1015 |
-+ T(PACKAGE_DEPENDENCY) |
1016 |
-+ T(PACKAGE_CONFLICTS) |
1017 |
-+ T(PACKAGE_REPLACES) |
1018 |
-+ T(PACKAGE_PROVIDES) |
1019 |
-+ T(PACKAGE_RECOMMENDS) |
1020 |
-+ T(PACKAGE_SUGGESTS) |
1021 |
-+ T(PACKAGE_MAINTAINER) |
1022 |
-+ T(PACKAGE_INSTALLED_SIZE) |
1023 |
-+ T(PACKAGE_SOURCE) |
1024 |
-+ T(PACKAGE_ESSENTIAL) |
1025 |
-+ T(TARGET_ARCHITECTURE) |
1026 |
-+ T(PACKAGE_PRE_DEPENDENCY) |
1027 |
-+ T(LICENSE) |
1028 |
-+ T(PACKAGE_DISTRIBUTION) |
1029 |
-+ T(BUILDHOST) |
1030 |
-+ T(VENDOR) |
1031 |
-+ T(TARGET_OS) |
1032 |
-+ T(SOFTWARE_VERSION) |
1033 |
-+ T(TARGET_PLATFORM) |
1034 |
-+ T(RESOURCE_TYPE) |
1035 |
-+ T(LIBRARY_SEARCH_PATH) |
1036 |
-+ T(LIBRARY_DEPENDENCY) |
1037 |
-+ |
1038 |
-+ T(CAMERA_MAKE) |
1039 |
-+ T(CAMERA_MODEL) |
1040 |
-+ T(EXPOSURE) |
1041 |
-+ T(APERTURE) |
1042 |
-+ T(EXPOSURE_BIAS) |
1043 |
-+ T(FLASH) |
1044 |
-+ T(FLASH_BIAS) |
1045 |
-+ T(FOCAL_LENGTH) |
1046 |
-+ T(FOCAL_LENGTH_35MM) |
1047 |
-+ T(ISO_SPEED) |
1048 |
-+ T(EXPOSURE_MODE) |
1049 |
-+ T(METERING_MODE) |
1050 |
-+ T(MACRO_MODE) |
1051 |
-+ T(IMAGE_QUALITY) |
1052 |
-+ T(WHITE_BALANCE) |
1053 |
-+ T(ORIENTATION) |
1054 |
-+ T(MAGNIFICATION) |
1055 |
-+ |
1056 |
-+ T(IMAGE_DIMENSIONS) |
1057 |
-+ T(PRODUCED_BY_SOFTWARE) |
1058 |
-+ T(THUMBNAIL) |
1059 |
-+ T(IMAGE_RESOLUTION) |
1060 |
-+ T(SOURCE) |
1061 |
-+ |
1062 |
-+ T(CHARACTER_SET) |
1063 |
-+ T(LINE_COUNT) |
1064 |
-+ T(PARAGRAPH_COUNT) |
1065 |
-+ T(WORD_COUNT) |
1066 |
-+ T(CHARACTER_COUNT) |
1067 |
-+ T(PAGE_ORIENTATION) |
1068 |
-+ T(PAPER_SIZE) |
1069 |
-+ T(TEMPLATE) |
1070 |
-+ T(COMPANY) |
1071 |
-+ T(MANAGER) |
1072 |
-+ T(REVISION_NUMBER) |
1073 |
-+ |
1074 |
-+ T(DURATION) |
1075 |
-+ T(ALBUM) |
1076 |
-+ T(ARTIST) |
1077 |
-+ T(GENRE) |
1078 |
-+ T(TRACK_NUMBER) |
1079 |
-+ T(DISC_NUMBER) |
1080 |
-+ T(PERFORMER) |
1081 |
-+ T(CONTACT_INFORMATION) |
1082 |
-+ T(SONG_VERSION) |
1083 |
-+ T(PICTURE) |
1084 |
-+ T(COVER_PICTURE) |
1085 |
-+ T(CONTRIBUTOR_PICTURE) |
1086 |
-+ T(EVENT_PICTURE) |
1087 |
-+ T(LOGO) |
1088 |
-+ T(BROADCAST_TELEVISION_SYSTEM) |
1089 |
-+ T(SOURCE_DEVICE) |
1090 |
-+ T(DISCLAIMER) |
1091 |
-+ T(WARNING) |
1092 |
-+ T(PAGE_ORDER) |
1093 |
-+ T(WRITER) |
1094 |
-+ T(PRODUCT_VERSION) |
1095 |
-+ T(CONTRIBUTOR_NAME) |
1096 |
-+ T(MOVIE_DIRECTOR) |
1097 |
-+ T(NETWORK_NAME) |
1098 |
-+ T(SHOW_NAME) |
1099 |
-+ T(CHAPTER_NAME) |
1100 |
-+ T(SONG_COUNT) |
1101 |
-+ T(STARTING_SONG) |
1102 |
-+ T(PLAY_COUNTER) |
1103 |
-+ T(CONDUCTOR) |
1104 |
-+ T(INTERPRETATION) |
1105 |
-+ T(COMPOSER) |
1106 |
-+ T(BEATS_PER_MINUTE) |
1107 |
-+ T(ENCODED_BY) |
1108 |
-+ T(ORIGINAL_TITLE) |
1109 |
-+ T(ORIGINAL_ARTIST) |
1110 |
-+ T(ORIGINAL_WRITER) |
1111 |
-+ T(ORIGINAL_RELEASE_YEAR) |
1112 |
-+ T(ORIGINAL_PERFORMER) |
1113 |
-+ T(LYRICS) |
1114 |
-+ T(POPULARITY_METER) |
1115 |
-+ T(LICENSEE) |
1116 |
-+ T(MUSICIAN_CREDITS_LIST) |
1117 |
-+ T(MOOD) |
1118 |
-+ T(SUBTITLE) |
1119 |
-+ |
1120 |
-+ T(GNUNET_DISPLAY_TYPE) |
1121 |
-+ T(GNUNET_FULL_DATA) |
1122 |
-+ T(RATING) |
1123 |
-+ T(ORGANIZATION) |
1124 |
-+ T(RIPPER) |
1125 |
-+ T(PRODUCER) |
1126 |
-+ T(GROUP) |
1127 |
-+ T(GNUNET_ORIGINAL_FILENAME) |
1128 |
-+ }; |
1129 |
-+#undef T |
1130 |
-+ size_t i; |
1131 |
-+ |
1132 |
-+ for (i = 0; i < sizeof(types) / sizeof(types[0]); ++i) |
1133 |
-+ if (!strcmp(types[i], tag.c_str())) |
1134 |
-+ return (EXTRACTOR_MetaType) i; |
1135 |
- |
1136 |
- log_warning("Ignoring unknown libextractor tag: %s\n", tag.c_str()); |
1137 |
-- return EXTRACTOR_UNKNOWN; |
1138 |
-+ return EXTRACTOR_METATYPE_UNKNOWN; |
1139 |
- } |
1140 |
- |
1141 |
--static void addMetaField(metadata_fields_t field, EXTRACTOR_KeywordList *keywords, Ref<CdsItem> item, Ref<StringConverter> sc) |
1142 |
-+struct field_state { |
1143 |
-+ Ref<CdsItem> item; |
1144 |
-+ Ref<StringConverter> sc; |
1145 |
-+ Ref<Array<StringBase> > aux; |
1146 |
-+}; |
1147 |
-+ |
1148 |
-+static int addField(void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, |
1149 |
-+ enum EXTRACTOR_MetaFormat format, const char *data_mime_type, |
1150 |
-+ const char *data, size_t data_len) |
1151 |
- { |
1152 |
-- String value; |
1153 |
-- const char *temp = NULL; |
1154 |
-- |
1155 |
-+ metadata_fields_t field = M_MAX; |
1156 |
-+ resource_attributes_t attr = R_MAX; |
1157 |
-+ |
1158 |
-+ if (!data) |
1159 |
-+ return 0; |
1160 |
-+ |
1161 |
-+ log_debug("metadata %zu [%s] -> %s\n", (size_t)type, EXTRACTOR_metatype_to_string(type), data); |
1162 |
-+ |
1163 |
- /// \todo check if UTF-8 conversion is needed, may already be in UTF-8 |
1164 |
-- |
1165 |
-- switch (field) |
1166 |
-+ |
1167 |
-+ switch (type) |
1168 |
- { |
1169 |
-- case M_TITLE: |
1170 |
-- temp = EXTRACTOR_extractLast(EXTRACTOR_TITLE, keywords); |
1171 |
-+ case EXTRACTOR_METATYPE_TITLE: |
1172 |
-+ field = M_TITLE; |
1173 |
- break; |
1174 |
-- case M_ARTIST: |
1175 |
-- temp = EXTRACTOR_extractLast(EXTRACTOR_ARTIST, keywords); |
1176 |
-+ case EXTRACTOR_METATYPE_ARTIST: |
1177 |
-+ field = M_ARTIST; |
1178 |
- break; |
1179 |
-- case M_ALBUM: |
1180 |
-- temp = EXTRACTOR_extractLast(EXTRACTOR_ALBUM, keywords); |
1181 |
-+ case EXTRACTOR_METATYPE_ALBUM: |
1182 |
-+ field = M_ALBUM; |
1183 |
- break; |
1184 |
-- case M_DATE: |
1185 |
-- temp = EXTRACTOR_extractLast(EXTRACTOR_DATE, keywords); |
1186 |
-+ case EXTRACTOR_METATYPE_PUBLICATION_YEAR: |
1187 |
-+ field = M_DATE; |
1188 |
- break; |
1189 |
-- case M_GENRE: |
1190 |
-- temp = EXTRACTOR_extractLast(EXTRACTOR_GENRE, keywords); |
1191 |
-+ case EXTRACTOR_METATYPE_GENRE: |
1192 |
-+ field = M_GENRE; |
1193 |
- break; |
1194 |
-- case M_DESCRIPTION: |
1195 |
-- temp = EXTRACTOR_extractLast(EXTRACTOR_DESCRIPTION, keywords); |
1196 |
-- |
1197 |
-- if (temp == NULL) |
1198 |
-- temp = EXTRACTOR_extractLast(EXTRACTOR_COMMENT, keywords); |
1199 |
-+ case EXTRACTOR_METATYPE_DESCRIPTION: |
1200 |
-+ field = M_DESCRIPTION; |
1201 |
-+ break; |
1202 |
-+ case EXTRACTOR_METATYPE_COMMENT: |
1203 |
-+ field = M_DESCRIPTION; |
1204 |
-+ break; |
1205 |
-+ case EXTRACTOR_METATYPE_IMAGE_DIMENSIONS: |
1206 |
-+ attr = R_RESOLUTION; |
1207 |
- break; |
1208 |
-- default: |
1209 |
-- return; |
1210 |
- } |
1211 |
- |
1212 |
-- if (temp != NULL) |
1213 |
-- value = temp; |
1214 |
-+ String value; |
1215 |
-+ struct field_state *field_state = (struct field_state *)cls; |
1216 |
-+ Ref<CdsItem> item = field_state->item; |
1217 |
-+ Ref<StringConverter> sc = field_state->sc; |
1218 |
-+ Ref<Array<StringBase> > aux = field_state->aux; |
1219 |
-+ |
1220 |
-+ if (field == M_MAX && attr == R_MAX && aux == nil) |
1221 |
-+ { |
1222 |
-+ log_debug("no match\n"); |
1223 |
-+ return 0; |
1224 |
-+ } |
1225 |
- |
1226 |
-+ value = data; |
1227 |
- value = trim_string(value); |
1228 |
-- |
1229 |
-- if (string_ok(value)) |
1230 |
-+ if (!string_ok(value)) |
1231 |
-+ return 0; |
1232 |
-+ |
1233 |
-+ if (field != M_MAX) |
1234 |
- { |
1235 |
- item->setMetadata(MT_KEYS[field].upnp, sc->convert(value)); |
1236 |
--// log_debug("Setting metadata on item: %d, %s\n", field, sc->convert(value).c_str()); |
1237 |
-+ log_debug("Setting metadata on item: %d, %s\n", field, sc->convert(value).c_str()); |
1238 |
- } |
1239 |
--} |
1240 |
- |
1241 |
--static void addResourceField(resource_attributes_t attr, EXTRACTOR_KeywordList *keywords, Ref<CdsItem> item, Ref<StringConverter> sc) |
1242 |
--{ |
1243 |
-- String value; |
1244 |
-- const char *temp = NULL; |
1245 |
-- |
1246 |
-- switch (attr) |
1247 |
-+ if (attr != R_MAX) |
1248 |
- { |
1249 |
-- case R_RESOLUTION: |
1250 |
-- temp = EXTRACTOR_extractLast(EXTRACTOR_SIZE, keywords); |
1251 |
-- break; |
1252 |
--/* case R_SIZE: |
1253 |
-- temp = EXTRACTOR_extractLast(EXTRACTOR_SIZE, keywords); |
1254 |
-- break; |
1255 |
--*/ |
1256 |
-- default: |
1257 |
-- return; |
1258 |
-+ item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(attr), value); |
1259 |
-+ log_debug("Setting attribute on item: %d, %s\n", attr, value.c_str()); |
1260 |
- } |
1261 |
- |
1262 |
-- if (temp != NULL) |
1263 |
-- value = temp; |
1264 |
-- |
1265 |
-- if (string_ok(value)) |
1266 |
-+ if (aux != nil) |
1267 |
- { |
1268 |
-- item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(attr), value); |
1269 |
-+ String tmp; |
1270 |
-+ for (int j = 0; j < aux->size(); j++) |
1271 |
-+ { |
1272 |
-+ tmp = aux->get(j); |
1273 |
-+ if (string_ok(tmp)) |
1274 |
-+ { |
1275 |
-+ if (type == getTagFromString(tmp)) |
1276 |
-+ { |
1277 |
-+ value = sc->convert(value); |
1278 |
-+ item->setAuxData(tmp, value); |
1279 |
-+ log_debug(("Adding tag: %s with value %s\n", tmp.c_str(), value.c_str())); |
1280 |
-+ } |
1281 |
-+ } |
1282 |
-+ } |
1283 |
- } |
1284 |
-+ |
1285 |
-+ return 0; |
1286 |
- } |
1287 |
- |
1288 |
- |
1289 |
- |
1290 |
--Ref<RExp> ReAudioFormat; |
1291 |
--EXTRACTOR_ExtractorList *extractors = NULL; |
1292 |
--bool load_libraries_failed = false; |
1293 |
-+static Ref<RExp> ReAudioFormat; |
1294 |
-+static EXTRACTOR_PluginList *plugins = NULL; |
1295 |
-+static bool load_libraries_failed = false; |
1296 |
- |
1297 |
- void ExtractorHandler::fillMetadata(Ref<CdsItem> item) |
1298 |
- { |
1299 |
- if (load_libraries_failed) |
1300 |
- return; |
1301 |
-- Ref<Array<StringBase> > aux; |
1302 |
-- Ref<StringConverter> sc = StringConverter::i2i(); |
1303 |
-- |
1304 |
-- if (! extractors) |
1305 |
-+ if (! plugins) |
1306 |
- { |
1307 |
-- extractors = EXTRACTOR_loadDefaultLibraries(); |
1308 |
-- if (! extractors) |
1309 |
-+ plugins = EXTRACTOR_plugin_add_defaults(EXTRACTOR_OPTION_DEFAULT_POLICY); |
1310 |
-+ if (! plugins) |
1311 |
-+ { |
1312 |
- load_libraries_failed = true; |
1313 |
-+ return; |
1314 |
-+ } |
1315 |
- } |
1316 |
-- EXTRACTOR_KeywordList *keywords = EXTRACTOR_getKeywords(extractors, item->getLocation().c_str()); |
1317 |
-- |
1318 |
-- //EXTRACTOR_printKeywords(stdout, keywords); |
1319 |
- |
1320 |
-- for (int i = 0; i < M_MAX; i++) |
1321 |
-- addMetaField((metadata_fields_t)i, keywords, item, sc); |
1322 |
-- |
1323 |
-- for (int i = 0; i < R_MAX; i++) |
1324 |
-- addResourceField((resource_attributes_t)i, keywords, item, sc); |
1325 |
-+ log_debug("processing %s\n", item->getLocation().c_str()); |
1326 |
- |
1327 |
- Ref<ConfigManager> cm = ConfigManager::getInstance(); |
1328 |
-- aux = cm->getStringArrayOption(CFG_IMPORT_LIBOPTS_EXTRACTOR_AUXDATA_TAGS_LIST); |
1329 |
-- if (aux != nil) |
1330 |
-- { |
1331 |
-- String value; |
1332 |
-- String tmp; |
1333 |
-- const char *temp = NULL; |
1334 |
-- |
1335 |
-- for (int j = 0; j < aux->size(); j++) |
1336 |
-- { |
1337 |
-- |
1338 |
-- tmp = aux->get(j); |
1339 |
-- if (string_ok(tmp)) |
1340 |
-- { |
1341 |
-- temp = EXTRACTOR_extractLast(getTagFromString(tmp), keywords); |
1342 |
-- if (temp != NULL) |
1343 |
-- { |
1344 |
-- value = temp; |
1345 |
-- if (string_ok(value)) |
1346 |
-- { |
1347 |
-- value = sc->convert(value); |
1348 |
-- item->setAuxData(tmp, value); |
1349 |
--// log_debug(("Adding tag: %s with value %s\n", tmp.c_str(), value.c_str())); |
1350 |
-- } |
1351 |
-- } |
1352 |
-- } |
1353 |
-- } |
1354 |
-- } |
1355 |
-+ struct field_state field_state = { |
1356 |
-+ .item = item, |
1357 |
-+ .sc = StringConverter::i2i(), |
1358 |
-+ .aux = cm->getStringArrayOption(CFG_IMPORT_LIBOPTS_EXTRACTOR_AUXDATA_TAGS_LIST), |
1359 |
-+ }; |
1360 |
-+ EXTRACTOR_extract(plugins, item->getLocation().c_str(), NULL, 0, addField, &field_state); |
1361 |
- |
1362 |
- if (ReAudioFormat == nil) |
1363 |
- { |
1364 |
-@@ -379,35 +401,9 @@ void ExtractorHandler::fillMetadata(Ref<CdsItem> item) |
1365 |
- ReAudioFormat->compile(_("([0-9]+)\\s+kbps,\\s*([0-9]+)\\s+hz,\\s*" |
1366 |
- "(([0-9]+)h)?([0-9]+)m([0-9]+)\\s(\\S+)"), "i"); |
1367 |
- } |
1368 |
-- |
1369 |
-- /* |
1370 |
-- temp = EXTRACTOR_extractLast(EXTRACTOR_FORMAT, keywords); |
1371 |
-- log_debug("EXTRACTOR_FORMAT: %s\n", temp); |
1372 |
-- |
1373 |
-- if (temp) |
1374 |
-- { |
1375 |
-- Ref<Matcher> matcher = ReAudioFormat->match((char *)temp); |
1376 |
-- if (matcher != nil) |
1377 |
-- { |
1378 |
-- log_debug(("BR:%s FR:%s H:%s M:%s S:%s TYPE:%s\n", |
1379 |
-- matcher->group(1).c_str(), |
1380 |
-- matcher->group(2).c_str(), |
1381 |
-- matcher->group(4).c_str(), |
1382 |
-- matcher->group(5).c_str(), |
1383 |
-- matcher->group(6).c_str(), |
1384 |
-- matcher->group(7).c_str())); |
1385 |
-- } |
1386 |
-- else |
1387 |
-- { |
1388 |
-- log_debug(("format pattern unmatched!")); |
1389 |
-- } |
1390 |
-- } |
1391 |
-- |
1392 |
-- */ |
1393 |
-- EXTRACTOR_freeKeywords(keywords); |
1394 |
- |
1395 |
- // commented out for the sake of efficiency |
1396 |
-- // EXTRACTOR_removeAll(extractors); |
1397 |
-+ // EXTRACTOR_plugin_remove_all(plugins); |
1398 |
- } |
1399 |
- |
1400 |
- Ref<IOHandler> ExtractorHandler::serveContent(Ref<CdsItem> item, int resNum, off_t *data_size) |
1401 |
|
1402 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1-libmp4v2.patch b/net-misc/mediatomb/files/mediatomb-0.12.1-libmp4v2.patch |
1403 |
deleted file mode 100644 |
1404 |
index 6a6b51e1e05..00000000000 |
1405 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1-libmp4v2.patch |
1406 |
+++ /dev/null |
1407 |
@@ -1,187 +0,0 @@ |
1408 |
-diff -urN old/src/metadata/libmp4v2_handler.cc new/src/metadata/libmp4v2_handler.cc |
1409 |
---- old/src/metadata/libmp4v2_handler.cc 2012-04-05 01:46:26.000000000 +0200 |
1410 |
-+++ new/src/metadata/libmp4v2_handler.cc 2012-04-05 02:01:24.000000000 +0200 |
1411 |
-@@ -65,29 +65,28 @@ |
1412 |
- static void addMetaField(metadata_fields_t field, MP4FileHandle mp4, Ref<CdsItem> item) |
1413 |
- { |
1414 |
- String value; |
1415 |
-- char* mp4_retval = NULL; |
1416 |
-- u_int16_t track; |
1417 |
-- u_int16_t total_tracks; |
1418 |
-- |
1419 |
- Ref<StringConverter> sc = StringConverter::i2i(); |
1420 |
- |
1421 |
-+ const MP4Tags* new_tags = MP4TagsAlloc(); |
1422 |
-+ |
1423 |
-+ if (!MP4TagsFetch(new_tags, mp4)) |
1424 |
-+ return; |
1425 |
-+ |
1426 |
- switch (field) |
1427 |
- { |
1428 |
- case M_TITLE: |
1429 |
-- MP4GetMetadataName(mp4, &mp4_retval); |
1430 |
-+ value = new_tags->name; |
1431 |
- break; |
1432 |
- case M_ARTIST: |
1433 |
-- MP4GetMetadataArtist(mp4, &mp4_retval); |
1434 |
-+ value = new_tags->artist; |
1435 |
- break; |
1436 |
- case M_ALBUM: |
1437 |
-- MP4GetMetadataAlbum(mp4, &mp4_retval); |
1438 |
-+ value = new_tags->album; |
1439 |
- break; |
1440 |
- case M_DATE: |
1441 |
-- MP4GetMetadataYear(mp4, &mp4_retval); |
1442 |
-- if (mp4_retval) |
1443 |
-+ value = new_tags->releaseDate; |
1444 |
-+ if (value.length() > 0) |
1445 |
- { |
1446 |
-- value = mp4_retval; |
1447 |
-- free(mp4_retval); |
1448 |
- if (string_ok(value)) |
1449 |
- value = value + "-01-01"; |
1450 |
- else |
1451 |
-@@ -95,34 +94,31 @@ |
1452 |
- } |
1453 |
- break; |
1454 |
- case M_GENRE: |
1455 |
-- MP4GetMetadataGenre(mp4, &mp4_retval); |
1456 |
-+ value = new_tags->genre; |
1457 |
- break; |
1458 |
- case M_DESCRIPTION: |
1459 |
-- MP4GetMetadataComment(mp4, &mp4_retval); |
1460 |
-+ value = new_tags->comments; |
1461 |
- break; |
1462 |
- case M_TRACKNUMBER: |
1463 |
-- MP4GetMetadataTrack(mp4, &track, &total_tracks); |
1464 |
-- if (track > 0) |
1465 |
-+ if (new_tags->track) |
1466 |
- { |
1467 |
-- value = String::from(track); |
1468 |
-- item->setTrackNumber((int)track); |
1469 |
-+ value = String::from(new_tags->track->index); |
1470 |
-+ item->setTrackNumber((int)new_tags->track->index); |
1471 |
- } |
1472 |
- else |
1473 |
-+ { |
1474 |
-+ MP4TagsFree( new_tags ); |
1475 |
- return; |
1476 |
-+ } |
1477 |
- break; |
1478 |
- default: |
1479 |
-+ MP4TagsFree( new_tags ); |
1480 |
- return; |
1481 |
- } |
1482 |
- |
1483 |
-- if ((field != M_DATE) && (field != M_TRACKNUMBER) && |
1484 |
-- (mp4_retval)) |
1485 |
-- { |
1486 |
-- value = mp4_retval; |
1487 |
-- free(mp4_retval); |
1488 |
-- } |
1489 |
-- |
1490 |
-+ MP4TagsFree( new_tags ); |
1491 |
- value = trim_string(value); |
1492 |
-- |
1493 |
-+ |
1494 |
- if (string_ok(value)) |
1495 |
- { |
1496 |
- item->setMetadata(MT_KEYS[field].upnp, sc->convert(value)); |
1497 |
-@@ -190,14 +186,19 @@ |
1498 |
- } |
1499 |
- |
1500 |
- #if defined(HAVE_MAGIC) |
1501 |
-- u_int8_t *art_data; |
1502 |
-- u_int32_t art_data_len; |
1503 |
-+ void *art_data = 0; |
1504 |
-+ u_int32_t art_data_len = 0; |
1505 |
- String art_mimetype; |
1506 |
-+ |
1507 |
-+ const MP4Tags* new_tags = MP4TagsAlloc(); |
1508 |
-+ MP4TagsFetch(new_tags, mp4); |
1509 |
-+ if (new_tags->artworkCount) |
1510 |
-+ { |
1511 |
-+ art_data = new_tags->artwork->data; |
1512 |
-+ art_data_len = new_tags->artwork->size; |
1513 |
-+ } |
1514 |
- #ifdef HAVE_MP4_GET_METADATA_COVER_ART_COUNT |
1515 |
-- if (MP4GetMetadataCoverArtCount(mp4) && |
1516 |
-- MP4GetMetadataCoverArt(mp4, &art_data, &art_data_len)) |
1517 |
--#else |
1518 |
-- MP4GetMetadataCoverArt(mp4, &art_data, &art_data_len); |
1519 |
-+ if (new_tags->artworkCount && art_data_len > 0) |
1520 |
- #endif |
1521 |
- { |
1522 |
- if (art_data) |
1523 |
-@@ -211,11 +212,10 @@ |
1524 |
- } |
1525 |
- catch (Exception ex) |
1526 |
- { |
1527 |
-- free(art_data); |
1528 |
-+ MP4TagsFree(new_tags); |
1529 |
- throw ex; |
1530 |
- } |
1531 |
- |
1532 |
-- free(art_data); |
1533 |
- if (art_mimetype != _(MIMETYPE_DEFAULT)) |
1534 |
- { |
1535 |
- Ref<CdsResource> resource(new CdsResource(CH_MP4)); |
1536 |
-@@ -225,6 +225,7 @@ |
1537 |
- } |
1538 |
- } |
1539 |
- } |
1540 |
-+ MP4TagsFree(new_tags); |
1541 |
- #endif |
1542 |
- MP4Close(mp4); |
1543 |
- } |
1544 |
-@@ -249,26 +250,35 @@ |
1545 |
- |
1546 |
- if (ctype != ID3_ALBUM_ART) |
1547 |
- throw _Exception(_("LibMP4V2Handler: got unknown content type: ") + ctype); |
1548 |
-+ |
1549 |
-+ const MP4Tags* new_tags = MP4TagsAlloc(); |
1550 |
-+ if (MP4TagsFetch(new_tags, mp4)) |
1551 |
-+ { |
1552 |
- #ifdef HAVE_MP4_GET_METADATA_COVER_ART_COUNT |
1553 |
-- if (!MP4GetMetadataCoverArtCount(mp4)) |
1554 |
-- throw _Exception(_("LibMP4V2Handler: resource has no album art information")); |
1555 |
-+ if (!new_tags->artworkCount) |
1556 |
-+ throw _Exception(_("LibMP4V2Handler: resource has no album art information")); |
1557 |
- #endif |
1558 |
-- u_int8_t *art_data; |
1559 |
-- u_int32_t art_data_len; |
1560 |
-- if (MP4GetMetadataCoverArt(mp4, &art_data, &art_data_len)) |
1561 |
-- { |
1562 |
-- if (art_data) |
1563 |
-+ void *art_data = 0; |
1564 |
-+ u_int32_t art_data_len; |
1565 |
-+ |
1566 |
-+ const MP4TagArtwork* art = new_tags->artwork; |
1567 |
-+ art_data = art->data; |
1568 |
-+ art_data_len = art->size; |
1569 |
-+ if (art) |
1570 |
- { |
1571 |
-- *data_size = (off_t)art_data_len; |
1572 |
-- Ref<IOHandler> h(new MemIOHandler((void *)art_data, art_data_len)); |
1573 |
-- free(art_data); |
1574 |
-- return h; |
1575 |
-+ if (art_data) |
1576 |
-+ { |
1577 |
-+ *data_size = (off_t)art_data_len; |
1578 |
-+ Ref<IOHandler> h(new MemIOHandler(art_data, art_data_len)); |
1579 |
-+ MP4TagsFree(new_tags); |
1580 |
-+ return h; |
1581 |
-+ } |
1582 |
- } |
1583 |
-+ MP4TagsFree(new_tags); |
1584 |
- } |
1585 |
-- |
1586 |
- throw _Exception(_("LibMP4V2Handler: could not serve album art " |
1587 |
-- "for file") + item->getLocation() + |
1588 |
-- " - embedded image not found"); |
1589 |
-+ "for file") + item->getLocation() + |
1590 |
-+ " - embedded image not found"); |
1591 |
- } |
1592 |
- |
1593 |
- #endif // HAVE_LIBMP4V2 |
1594 |
-De binära filerna old/src/metadata/.libmp4v2_handler.cc.swp och new/src/metadata/.libmp4v2_handler.cc.swp skiljer |
1595 |
|
1596 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1-mozjs187.patch b/net-misc/mediatomb/files/mediatomb-0.12.1-mozjs187.patch |
1597 |
deleted file mode 100644 |
1598 |
index c4b080a3656..00000000000 |
1599 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1-mozjs187.patch |
1600 |
+++ /dev/null |
1601 |
@@ -1,260 +0,0 @@ |
1602 |
-maybe this is correct, maybe it's not. spidermonkey's documentation blows, so |
1603 |
-who is to say! |
1604 |
- |
1605 |
-https://bugs.gentoo.org/423991 |
1606 |
- |
1607 |
---- a/src/scripting/dvd_image_import_script.cc |
1608 |
-+++ b/src/scripting/dvd_image_import_script.cc |
1609 |
-@@ -232,8 +232,6 @@ DVDImportScript::DVDImportScript(Ref<Runtime> runtime) : Script(runtime) |
1610 |
- |
1611 |
- String scriptPath = ConfigManager::getInstance()->getOption(CFG_IMPORT_SCRIPTING_DVD_SCRIPT); |
1612 |
- load(scriptPath); |
1613 |
-- root = JS_NewScriptObject(cx, script); |
1614 |
-- JS_AddNamedRoot(cx, &root, "DVDImportScript"); |
1615 |
- log_info("Loaded %s\n", scriptPath.c_str()); |
1616 |
- |
1617 |
- Ref<Dictionary> mappings = |
1618 |
-@@ -296,21 +294,4 @@ void DVDImportScript::processDVDObject(Ref<CdsObject> obj) |
1619 |
- #endif |
1620 |
- } |
1621 |
- |
1622 |
--DVDImportScript::~DVDImportScript() |
1623 |
--{ |
1624 |
--#ifdef JS_THREADSAFE |
1625 |
-- JS_SetContextThread(cx); |
1626 |
-- JS_BeginRequest(cx); |
1627 |
--#endif |
1628 |
-- |
1629 |
-- if (root) |
1630 |
-- JS_RemoveRoot(cx, &root); |
1631 |
-- |
1632 |
--#ifdef JS_THREADSAFE |
1633 |
-- JS_EndRequest(cx); |
1634 |
-- JS_ClearContextThread(cx); |
1635 |
--#endif |
1636 |
-- |
1637 |
--} |
1638 |
-- |
1639 |
- #endif // HAVE_JS |
1640 |
---- a/src/scripting/dvd_image_import_script.h |
1641 |
-+++ b/src/scripting/dvd_image_import_script.h |
1642 |
-@@ -41,7 +41,6 @@ class DVDImportScript : public Script |
1643 |
- { |
1644 |
- public: |
1645 |
- DVDImportScript(zmm::Ref<Runtime> runtime); |
1646 |
-- ~DVDImportScript(); |
1647 |
- /// \brief Adds a DVD object to the database |
1648 |
- /// |
1649 |
- /// \param title DVD title number |
1650 |
---- a/src/scripting/import_script.cc |
1651 |
-+++ b/src/scripting/import_script.cc |
1652 |
-@@ -53,8 +53,6 @@ ImportScript::ImportScript(Ref<Runtime> runtime) : Script(runtime) |
1653 |
- try |
1654 |
- { |
1655 |
- load(scriptPath); |
1656 |
-- root = JS_NewObject(cx, NULL, script, NULL); |
1657 |
-- JS_AddNamedObjectRoot(cx, &root, "ImportScript"); |
1658 |
- } |
1659 |
- catch (Exception ex) |
1660 |
- { |
1661 |
-@@ -109,21 +107,4 @@ void ImportScript::processCdsObject(Ref<CdsObject> obj, String rootpath) |
1662 |
- #endif |
1663 |
- } |
1664 |
- |
1665 |
--ImportScript::~ImportScript() |
1666 |
--{ |
1667 |
--#ifdef JS_THREADSAFE |
1668 |
-- JS_SetContextThread(cx); |
1669 |
-- JS_BeginRequest(cx); |
1670 |
--#endif |
1671 |
-- |
1672 |
-- if (root) |
1673 |
-- JS_RemoveObjectRoot(cx, &root); |
1674 |
-- |
1675 |
--#ifdef JS_THREADSAFE |
1676 |
-- JS_EndRequest(cx); |
1677 |
-- JS_ClearContextThread(cx); |
1678 |
--#endif |
1679 |
-- |
1680 |
--} |
1681 |
-- |
1682 |
- #endif // HAVE_JS |
1683 |
---- a/src/scripting/import_script.h |
1684 |
-+++ b/src/scripting/import_script.h |
1685 |
-@@ -41,11 +41,8 @@ class ImportScript : public Script |
1686 |
- { |
1687 |
- public: |
1688 |
- ImportScript(zmm::Ref<Runtime> runtime); |
1689 |
-- ~ImportScript(); |
1690 |
- void processCdsObject(zmm::Ref<CdsObject> obj, zmm::String rootpath); |
1691 |
- virtual script_class_t whoami() { return S_IMPORT; } |
1692 |
--private: |
1693 |
-- JSObject *root; |
1694 |
- }; |
1695 |
- |
1696 |
- #endif // __SCRIPTING_IMPORT_SCRIPT_H__ |
1697 |
---- a/src/scripting/playlist_parser_script.cc |
1698 |
-+++ b/src/scripting/playlist_parser_script.cc |
1699 |
-@@ -93,8 +93,6 @@ PlaylistParserScript::PlaylistParserScript(Ref<Runtime> runtime) : Script(runtim |
1700 |
- |
1701 |
- String scriptPath = ConfigManager::getInstance()->getOption(CFG_IMPORT_SCRIPTING_PLAYLIST_SCRIPT); |
1702 |
- load(scriptPath); |
1703 |
-- root = JS_NewObject(cx, NULL, script, NULL); |
1704 |
-- JS_AddNamedObjectRoot(cx, &root, "PlaylistScript"); |
1705 |
- } |
1706 |
- catch (Exception ex) |
1707 |
- { |
1708 |
-@@ -236,21 +234,4 @@ void PlaylistParserScript::processPlaylistObject(zmm::Ref<CdsObject> obj, Ref<Ge |
1709 |
- |
1710 |
- } |
1711 |
- |
1712 |
-- |
1713 |
--PlaylistParserScript::~PlaylistParserScript() |
1714 |
--{ |
1715 |
--#ifdef JS_THREADSAFE |
1716 |
-- JS_SetContextThread(cx); |
1717 |
-- JS_BeginRequest(cx); |
1718 |
--#endif |
1719 |
-- |
1720 |
-- if (root) |
1721 |
-- JS_RemoveObjectRoot(cx, &root); |
1722 |
-- |
1723 |
--#ifdef JS_THREADSAFE |
1724 |
-- JS_EndRequest(cx); |
1725 |
-- JS_ClearContextThread(cx); |
1726 |
--#endif |
1727 |
-- |
1728 |
--} |
1729 |
- #endif // HAVE_JS |
1730 |
---- a/src/scripting/playlist_parser_script.h |
1731 |
-+++ b/src/scripting/playlist_parser_script.h |
1732 |
-@@ -42,7 +42,6 @@ class PlaylistParserScript : public Script |
1733 |
- { |
1734 |
- public: |
1735 |
- PlaylistParserScript(zmm::Ref<Runtime> runtime); |
1736 |
-- ~PlaylistParserScript(); |
1737 |
- zmm::String readln(); |
1738 |
- void processPlaylistObject(zmm::Ref<CdsObject> obj, zmm::Ref<GenericTask> task); |
1739 |
- virtual script_class_t whoami() { return S_PLAYLIST; } |
1740 |
-@@ -52,7 +51,6 @@ private: |
1741 |
- int currentObjectID; |
1742 |
- char *currentLine; |
1743 |
- zmm::Ref<GenericTask> currentTask; |
1744 |
-- JSObject *root; |
1745 |
- }; |
1746 |
- |
1747 |
- #endif // __SCRIPTING_PLAYLIST_PARSER_SCRIPT_H__ |
1748 |
---- a/src/scripting/script.cc |
1749 |
-+++ b/src/scripting/script.cc |
1750 |
-@@ -427,15 +427,10 @@ static JSFunctionSpec js_global_functions[] = { |
1751 |
- try |
1752 |
- { |
1753 |
- common_script = _load(common_scr_path); |
1754 |
-- common_root = JS_NewObject(cx, NULL, common_script, NULL); |
1755 |
-- JS_AddNamedObjectRoot(cx, &common_root, "common-script"); |
1756 |
- _execute(common_script); |
1757 |
- } |
1758 |
- catch (Exception e) |
1759 |
- { |
1760 |
-- if (common_root) |
1761 |
-- JS_RemoveObjectRoot(cx, &common_root); |
1762 |
-- |
1763 |
- log_js("Unable to load %s: %s\n", common_scr_path.c_str(), |
1764 |
- e.getMessage().c_str()); |
1765 |
- } |
1766 |
-@@ -459,8 +454,6 @@ Script::~Script() |
1767 |
- JS_SetContextThread(cx); |
1768 |
- JS_BeginRequest(cx); |
1769 |
- #endif |
1770 |
-- if (common_root) |
1771 |
-- JS_RemoveObjectRoot(cx, &common_root); |
1772 |
- |
1773 |
- /* |
1774 |
- * scripts are unrooted and will be cleaned up by GC |
1775 |
-@@ -532,12 +532,12 @@ void Script::defineFunctions(JSFunctionSpec *functions) |
1776 |
- throw _Exception(_("Scripting: JS_DefineFunctions failed")); |
1777 |
- } |
1778 |
- |
1779 |
--JSObject *Script::_load(zmm::String scriptPath) |
1780 |
-+JSScript *Script::_load(zmm::String scriptPath) |
1781 |
- { |
1782 |
- if (glob == NULL) |
1783 |
- initGlobalObject(); |
1784 |
- |
1785 |
-- JSObject *scr; |
1786 |
-+ JSScript *scr; |
1787 |
- |
1788 |
- String scriptText = read_text_file(scriptPath); |
1789 |
- |
1790 |
-@@ -568,7 +568,7 @@ void Script::load(zmm::String scriptPath) |
1791 |
- } |
1792 |
- |
1793 |
- |
1794 |
--void Script::_execute(JSObject *scr) |
1795 |
-+void Script::_execute(JSScript *scr) |
1796 |
- { |
1797 |
- jsval ret_val; |
1798 |
- |
1799 |
---- a/src/scripting/script.h |
1800 |
-+++ b/src/scripting/script.h |
1801 |
-@@ -66,8 +66,8 @@ public: |
1802 |
- JSRuntime *rt; |
1803 |
- JSContext *cx; |
1804 |
- JSObject *glob; |
1805 |
-- JSObject *script; |
1806 |
-- JSObject *common_script; |
1807 |
-+ JSScript *script; |
1808 |
-+ JSScript *common_script; |
1809 |
- |
1810 |
- public: |
1811 |
- Script(zmm::Ref<Runtime> runtime); |
1812 |
-@@ -112,11 +112,9 @@ protected: |
1813 |
- zmm::Ref<CdsObject> processed; |
1814 |
- |
1815 |
- private: |
1816 |
-- JSObject *common_root; |
1817 |
-- |
1818 |
- void initGlobalObject(); |
1819 |
-- JSObject *_load(zmm::String scriptPath); |
1820 |
-- void _execute(JSObject *scr); |
1821 |
-+ JSScript *_load(zmm::String scriptPath); |
1822 |
-+ void _execute(JSScript *scr); |
1823 |
- zmm::Ref<StringConverter> _p2i; |
1824 |
- zmm::Ref<StringConverter> _j2i; |
1825 |
- zmm::Ref<StringConverter> _f2i; |
1826 |
---- a/configure.ac |
1827 |
-+++ b/configure.ac |
1828 |
-@@ -1036,13 +1036,13 @@ |
1829 |
- ], |
1830 |
- [ |
1831 |
- unset ac_cv_lib_smjs_JS_NewObject |
1832 |
-- AC_CHECK_LIB(mozjs185, JS_NewObject, |
1833 |
-+ AC_CHECK_LIB(mozjs187, JS_NewObject, |
1834 |
- [ |
1835 |
-- MOZLIB=mozjs185 |
1836 |
-- JS_LIBS="-lmozjs185" |
1837 |
-+ MOZLIB=mozjs187 |
1838 |
-+ JS_LIBS="-lmozjs187" |
1839 |
- ], |
1840 |
- [ |
1841 |
-- unset ac_cv_lib_mozjs185_JS_NewObject |
1842 |
-+ unset ac_cv_lib_mozjs187_JS_NewObject |
1843 |
- AC_CHECK_LIB(mozjs, JS_NewObject, |
1844 |
- [ |
1845 |
- MOZLIB=mozjs |
1846 |
-@@ -1064,11 +1064,11 @@ |
1847 |
- MOZLIB=smjs |
1848 |
- ], |
1849 |
- [ |
1850 |
-- unset ac_cv_lib_mozjs185_JS_NewObject |
1851 |
-- AC_CHECK_LIB(mozjs185, JS_NewObject, |
1852 |
-+ unset ac_cv_lib_mozjs187_JS_NewObject |
1853 |
-+ AC_CHECK_LIB(mozjs187, JS_NewObject, |
1854 |
- [ |
1855 |
-- JS_LIBS="-L$SEARCH_DIR_LIBS -lmozjs185" |
1856 |
-- MOZLIB=mozjs185 |
1857 |
-+ JS_LIBS="-L$SEARCH_DIR_LIBS -lmozjs187" |
1858 |
-+ MOZLIB=mozjs187 |
1859 |
- ], |
1860 |
- [ |
1861 |
- LDFLAGS="-L$SEARCH_DIR_LIBS $LDFLAGS_SAVE -lmozjs" |
1862 |
|
1863 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1-system-ar.patch b/net-misc/mediatomb/files/mediatomb-0.12.1-system-ar.patch |
1864 |
deleted file mode 100644 |
1865 |
index 349bf7d8da7..00000000000 |
1866 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1-system-ar.patch |
1867 |
+++ /dev/null |
1868 |
@@ -1,35 +0,0 @@ |
1869 |
---- configure.ac 2010-04-08 00:38:51.000000000 +0200 |
1870 |
-+++ configure.ac 2013-05-30 12:27:55.620514386 +0200 |
1871 |
-@@ -318,6 +318,10 @@ |
1872 |
- AC_PROG_CC |
1873 |
- AC_PROG_RANLIB |
1874 |
- AC_PROG_GCC_TRADITIONAL |
1875 |
-+AN_MAKEVAR([AR], [AC_PROG_AR]) |
1876 |
-+AN_PROGRAM([ar], [AC_PROG_AR]) |
1877 |
-+AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)]) |
1878 |
-+AC_PROG_AR |
1879 |
- AC_HEADER_DIRENT |
1880 |
- AC_HEADER_STDC |
1881 |
- AC_HEADER_SYS_WAIT |
1882 |
---- build/Makefile.in 2010-04-08 00:40:15.000000000 +0200 |
1883 |
-+++ build/Makefile.in 2013-05-30 12:25:55.310337928 +0200 |
1884 |
-@@ -50,7 +50,7 @@ |
1885 |
- CONFIG_CLEAN_FILES = |
1886 |
- CONFIG_CLEAN_VPATH_FILES = |
1887 |
- LIBRARIES = $(noinst_LIBRARIES) |
1888 |
--AR = ar |
1889 |
-+AR = @AR@ |
1890 |
- ARFLAGS = cru |
1891 |
- libmediatomb_a_AR = $(AR) $(ARFLAGS) |
1892 |
- libmediatomb_a_LIBADD = |
1893 |
---- tombupnp/build/Makefile.in 2010-04-08 00:40:16.000000000 +0200 |
1894 |
-+++ tombupnp/build/Makefile.in 2013-05-30 12:26:18.420371823 +0200 |
1895 |
-@@ -48,7 +48,7 @@ |
1896 |
- CONFIG_CLEAN_FILES = |
1897 |
- CONFIG_CLEAN_VPATH_FILES = |
1898 |
- LIBRARIES = $(noinst_LIBRARIES) |
1899 |
--AR = ar |
1900 |
-+AR = @AR@ |
1901 |
- ARFLAGS = cru |
1902 |
- libtombupnp_a_AR = $(AR) $(ARFLAGS) |
1903 |
- libtombupnp_a_LIBADD = |
1904 |
|
1905 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1-system-uuid.patch b/net-misc/mediatomb/files/mediatomb-0.12.1-system-uuid.patch |
1906 |
deleted file mode 100644 |
1907 |
index 053f18cea87..00000000000 |
1908 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1-system-uuid.patch |
1909 |
+++ /dev/null |
1910 |
@@ -1,36 +0,0 @@ |
1911 |
-use libuuid from the system rather than local bundled code |
1912 |
- |
1913 |
-http://bugs.gentoo.org/270830 |
1914 |
- |
1915 |
---- a/build/Makefile.am |
1916 |
-+++ b/build/Makefile.am |
1917 |
-@@ -58,6 +58,7 @@ mediatomb_CXXFLAGS = -I$(top_srcdir)/src \ |
1918 |
- mediatomb_LDADD = \ |
1919 |
- libmediatomb.a \ |
1920 |
- $(top_srcdir)/tombupnp/build/libtombupnp.a \ |
1921 |
-+ -luuid \ |
1922 |
- $(LIBEXIF_LDFLAGS) \ |
1923 |
- $(ZLIB_LDFLAGS) \ |
1924 |
- $(EXPAT_LDFLAGS) \ |
1925 |
---- a/build/libmediatomb_src |
1926 |
-+++ b/build/libmediatomb_src |
1927 |
-@@ -231,19 +231,6 @@ libmediatomb_a_SOURCES = \ |
1928 |
- ../src/url.h \ |
1929 |
- ../src/url_request_handler.cc \ |
1930 |
- ../src/url_request_handler.h \ |
1931 |
--../src/uuid/clear.c \ |
1932 |
--../src/uuid/compare.c \ |
1933 |
--../src/uuid/copy.c \ |
1934 |
--../src/uuid/gen_uuid.c \ |
1935 |
--../src/uuid/isnull.c \ |
1936 |
--../src/uuid/pack.c \ |
1937 |
--../src/uuid/parse.c \ |
1938 |
--../src/uuid/unpack.c \ |
1939 |
--../src/uuid/unparse.c \ |
1940 |
--../src/uuid/uuid.h \ |
1941 |
--../src/uuid/uuidP.h \ |
1942 |
--../src/uuid/uuid_time.c \ |
1943 |
--../src/uuid/uuid_types.h \ |
1944 |
- ../src/web/action.cc \ |
1945 |
- ../src/web/add.cc \ |
1946 |
- ../src/web/add_object.cc \ |
1947 |
|
1948 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1-thumb-cache.patch b/net-misc/mediatomb/files/mediatomb-0.12.1-thumb-cache.patch |
1949 |
deleted file mode 100644 |
1950 |
index 7de291a552b..00000000000 |
1951 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1-thumb-cache.patch |
1952 |
+++ /dev/null |
1953 |
@@ -1,237 +0,0 @@ |
1954 |
-https://sourceforge.net/tracker/?func=detail&aid=3291468&group_id=129766&atid=715782 |
1955 |
- |
1956 |
-[PATCH] Add the cache feature of ffmpegthumbnailer. |
1957 |
- |
1958 |
-I want the cache feature of ffmpegthumbnailer because my machine |
1959 |
-is not powerful :-( |
1960 |
-So I created this patch for the cache feature. |
1961 |
- |
1962 |
-This patch adds a new option "cache-dir" in config.xml. |
1963 |
-If not specifying any string, the cache feature is disable. |
1964 |
-And specifying some directory, the cache feature is enable |
1965 |
-and the cache files will be created under the directory. |
1966 |
- |
1967 |
-Signed-off-by: Ken'ichi Ohmichi <ken1ohmichi@×××××.com> |
1968 |
---- |
1969 |
-diff --git a/src/common.h b/src/common.h |
1970 |
-index d1998b3..358f4d1 100644 |
1971 |
---- a/src/common.h |
1972 |
-+++ b/src/common.h |
1973 |
-@@ -367,6 +367,8 @@ |
1974 |
- #define DEFAULT_FFMPEGTHUMBNAILER_FILMSTRIP_OVERLAY YES |
1975 |
- #define DEFAULT_FFMPEGTHUMBNAILER_WORKAROUND_BUGS NO |
1976 |
- #define DEFAULT_FFMPEGTHUMBNAILER_IMAGE_QUALITY 8 |
1977 |
-+ #define DEFAULT_FFMPEGTHUMBNAILER_CACHE_DIR_ENABLED YES |
1978 |
-+ #define DEFAULT_FFMPEGTHUMBNAILER_CACHE_DIR "" |
1979 |
- #endif |
1980 |
- |
1981 |
- #if defined(HAVE_LASTFMLIB) |
1982 |
-diff --git a/src/config_manager.cc b/src/config_manager.cc |
1983 |
-index 8c975f8..2902090 100644 |
1984 |
---- a/src/config_manager.cc |
1985 |
-+++ b/src/config_manager.cc |
1986 |
-@@ -1873,6 +1873,24 @@ void ConfigManager::validate(String serverhome) |
1987 |
- |
1988 |
- NEW_INT_OPTION(temp_int); |
1989 |
- SET_INT_OPTION(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_IMAGE_QUALITY); |
1990 |
-+ |
1991 |
-+ temp = getOption("/server/extended-runtime-options/ffmpegthumbnailer/" |
1992 |
-+ "cache-dir", DEFAULT_FFMPEGTHUMBNAILER_CACHE_DIR); |
1993 |
-+ |
1994 |
-+ NEW_OPTION(temp); |
1995 |
-+ SET_OPTION(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_CACHE_DIR); |
1996 |
-+ |
1997 |
-+ temp = getOption("/server/extended-runtime-options/ffmpegthumbnailer/" |
1998 |
-+ "cache-dir/attribute::enabled", |
1999 |
-+ DEFAULT_FFMPEGTHUMBNAILER_CACHE_DIR_ENABLED); |
2000 |
-+ |
2001 |
-+ if (!validateYesNo(temp)) |
2002 |
-+ throw _Exception(_("Error in config file: " |
2003 |
-+ "invalid \"enabled\" attribute value in " |
2004 |
-+ "ffmpegthumbnailer <cache-dir> tag")); |
2005 |
-+ |
2006 |
-+ NEW_BOOL_OPTION(temp == YES ? true : false); |
2007 |
-+ SET_BOOL_OPTION(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_CACHE_DIR_ENABLED); |
2008 |
- } |
2009 |
- #endif |
2010 |
- |
2011 |
-diff --git a/src/config_manager.h b/src/config_manager.h |
2012 |
-index 52b9842..a447a60 100644 |
2013 |
---- a/src/config_manager.h |
2014 |
-+++ b/src/config_manager.h |
2015 |
-@@ -110,6 +110,8 @@ typedef enum |
2016 |
- CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_FILMSTRIP_OVERLAY, |
2017 |
- CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_WORKAROUND_BUGS, |
2018 |
- CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_IMAGE_QUALITY, |
2019 |
-+ CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_CACHE_DIR_ENABLED, |
2020 |
-+ CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_CACHE_DIR, |
2021 |
- #endif |
2022 |
- CFG_SERVER_EXTOPTS_MARK_PLAYED_ITEMS_ENABLED, |
2023 |
- CFG_SERVER_EXTOPTS_MARK_PLAYED_ITEMS_STRING_MODE_PREPEND, |
2024 |
-diff --git a/src/metadata/ffmpeg_handler.cc b/src/metadata/ffmpeg_handler.cc |
2025 |
-index a637d9c..8e7ef23 100644 |
2026 |
---- a/src/metadata/ffmpeg_handler.cc |
2027 |
-+++ b/src/metadata/ffmpeg_handler.cc |
2028 |
-@@ -50,6 +50,9 @@ |
2029 |
- // INT64_C is not defined in ffmpeg/avformat.h but is needed |
2030 |
- // macro defines included via autoconfig.h |
2031 |
- #include <stdint.h> |
2032 |
-+#include <sys/stat.h> |
2033 |
-+#include <errno.h> |
2034 |
-+#include <string.h> |
2035 |
- |
2036 |
- //#ifdef FFMPEG_NEEDS_EXTERN_C |
2037 |
- extern "C" |
2038 |
-@@ -279,6 +282,122 @@ void FfmpegHandler::fillMetadata(Ref<CdsItem> item) |
2039 |
- av_close_input_file(pFormatCtx); |
2040 |
- } |
2041 |
- |
2042 |
-+#ifdef HAVE_FFMPEGTHUMBNAILER |
2043 |
-+ |
2044 |
-+static int _mkdir(const char *path) |
2045 |
-+{ |
2046 |
-+ int ret = mkdir(path, 0777); |
2047 |
-+ |
2048 |
-+ if (ret == 0) { |
2049 |
-+ // Make sure we are +x in case of restrictive umask that strips +x. |
2050 |
-+ struct stat st; |
2051 |
-+ if (stat(path, &st)) { |
2052 |
-+ log_warning("could not stat(%s): %s\n", path, strerror(errno)); |
2053 |
-+ return -1; |
2054 |
-+ } |
2055 |
-+ mode_t xbits = S_IXUSR | S_IXGRP | S_IXOTH; |
2056 |
-+ if (!(st.st_mode & xbits)) { |
2057 |
-+ if (chmod(path, st.st_mode | xbits)) { |
2058 |
-+ log_warning("could not chmod(%s, +x): %s\n", path, strerror(errno)); |
2059 |
-+ return -1; |
2060 |
-+ } |
2061 |
-+ } |
2062 |
-+ } |
2063 |
-+ |
2064 |
-+ return ret; |
2065 |
-+} |
2066 |
-+ |
2067 |
-+static bool makeThumbnailCacheDir(String& path) |
2068 |
-+{ |
2069 |
-+ char *path_temp = strdup(path.c_str()); |
2070 |
-+ char *last_slash = strrchr(path_temp, '/'); |
2071 |
-+ char *slash = last_slash; |
2072 |
-+ bool ret = false; |
2073 |
-+ |
2074 |
-+ if (!last_slash) |
2075 |
-+ return ret; |
2076 |
-+ |
2077 |
-+ // Assume most dirs exist, so scan backwards first. |
2078 |
-+ // Avoid stat/access checks due to TOCTOU races. |
2079 |
-+ errno = 0; |
2080 |
-+ for (slash = last_slash; slash > path_temp; --slash) { |
2081 |
-+ if (*slash != '/') |
2082 |
-+ continue; |
2083 |
-+ *slash = '\0'; |
2084 |
-+ if (_mkdir(path_temp) == 0) { |
2085 |
-+ // Now we can forward scan. |
2086 |
-+ while (slash < last_slash) { |
2087 |
-+ *slash = DIR_SEPARATOR; |
2088 |
-+ if (_mkdir(path_temp) < 0) |
2089 |
-+ // Allow EEXIST in case of someone else doing `mkdir`. |
2090 |
-+ if (errno != EEXIST) |
2091 |
-+ goto done; |
2092 |
-+ slash += strlen(slash); |
2093 |
-+ } |
2094 |
-+ if (slash == last_slash) |
2095 |
-+ ret = true; |
2096 |
-+ break; |
2097 |
-+ } else if (errno == EEXIST) { |
2098 |
-+ ret = true; |
2099 |
-+ break; |
2100 |
-+ } else if (errno != ENOENT) { |
2101 |
-+ break; |
2102 |
-+ } |
2103 |
-+ } |
2104 |
-+ |
2105 |
-+ done: |
2106 |
-+ free(path_temp); |
2107 |
-+ return ret; |
2108 |
-+} |
2109 |
-+ |
2110 |
-+static String getThumbnailCacheFilePath(String& movie_filename, bool create) |
2111 |
-+{ |
2112 |
-+ Ref<ConfigManager> cfg = ConfigManager::getInstance(); |
2113 |
-+ String cache_dir = cfg->getOption(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_CACHE_DIR); |
2114 |
-+ |
2115 |
-+ if (cache_dir.length() == 0) { |
2116 |
-+ String home_dir = cfg->getOption(CFG_SERVER_HOME); |
2117 |
-+ cache_dir = home_dir + "/cache-dir"; |
2118 |
-+ } |
2119 |
-+ |
2120 |
-+ cache_dir = cache_dir + movie_filename + "-thumb.jpg"; |
2121 |
-+ if (create && !makeThumbnailCacheDir(cache_dir)) |
2122 |
-+ cache_dir = ""; |
2123 |
-+ return cache_dir; |
2124 |
-+} |
2125 |
-+ |
2126 |
-+static bool readThumbnailCacheFile(String movie_filename, uint8_t **ptr_img, size_t *size_img) |
2127 |
-+{ |
2128 |
-+ String path = getThumbnailCacheFilePath(movie_filename, false); |
2129 |
-+ FILE *fp = fopen(path.c_str(), "rb"); |
2130 |
-+ if (!fp) |
2131 |
-+ return false; |
2132 |
-+ |
2133 |
-+ size_t bytesRead; |
2134 |
-+ uint8_t buffer[1024]; |
2135 |
-+ *ptr_img = NULL; |
2136 |
-+ *size_img = 0; |
2137 |
-+ while ((bytesRead = fread(buffer, 1, sizeof(buffer), fp)) > 0) { |
2138 |
-+ *ptr_img = (uint8_t *)realloc(*ptr_img, *size_img + bytesRead); |
2139 |
-+ memcpy(*ptr_img + *size_img, buffer, bytesRead); |
2140 |
-+ *size_img += bytesRead; |
2141 |
-+ } |
2142 |
-+ fclose(fp); |
2143 |
-+ return true; |
2144 |
-+} |
2145 |
-+ |
2146 |
-+static void writeThumbnailCacheFile(String movie_filename, uint8_t *ptr_img, int size_img) |
2147 |
-+{ |
2148 |
-+ String path = getThumbnailCacheFilePath(movie_filename, true); |
2149 |
-+ FILE *fp = fopen(path.c_str(), "wb"); |
2150 |
-+ if (!fp) |
2151 |
-+ return; |
2152 |
-+ fwrite(ptr_img, sizeof(uint8_t), size_img, fp); |
2153 |
-+ fclose(fp); |
2154 |
-+} |
2155 |
-+ |
2156 |
-+#endif |
2157 |
-+ |
2158 |
- Ref<IOHandler> FfmpegHandler::serveContent(Ref<CdsItem> item, int resNum, off_t *data_size) |
2159 |
- { |
2160 |
- *data_size = -1; |
2161 |
-@@ -288,6 +407,18 @@ Ref<IOHandler> FfmpegHandler::serveContent(Ref<CdsItem> item, int resNum, off_t |
2162 |
- if (!cfg->getBoolOption(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_ENABLED)) |
2163 |
- return nil; |
2164 |
- |
2165 |
-+ if (cfg->getBoolOption(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_CACHE_DIR_ENABLED)) { |
2166 |
-+ uint8_t *ptr_image; |
2167 |
-+ size_t size_image; |
2168 |
-+ if (readThumbnailCacheFile(item->getLocation(), |
2169 |
-+ &ptr_image, &size_image)) { |
2170 |
-+ *data_size = (off_t)size_image; |
2171 |
-+ Ref<IOHandler> h(new MemIOHandler(ptr_image, size_image)); |
2172 |
-+ free(ptr_image); |
2173 |
-+ log_debug("Returning cached thumbnail for file: %s\n", item->getLocation().c_str()); |
2174 |
-+ return h; |
2175 |
-+ } |
2176 |
-+ } |
2177 |
- #ifdef FFMPEGTHUMBNAILER_OLD_API |
2178 |
- video_thumbnailer *th = create_thumbnailer(); |
2179 |
- image_data *img = create_image_data(); |
2180 |
-@@ -318,6 +449,10 @@ Ref<IOHandler> FfmpegHandler::serveContent(Ref<CdsItem> item, int resNum, off_t |
2181 |
- #endif // old api |
2182 |
- throw _Exception(_("Could not generate thumbnail for ") + |
2183 |
- item->getLocation()); |
2184 |
-+ if (cfg->getBoolOption(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_CACHE_DIR_ENABLED)) { |
2185 |
-+ writeThumbnailCacheFile(item->getLocation(), |
2186 |
-+ img->image_data_ptr, img->image_data_size); |
2187 |
-+ } |
2188 |
- |
2189 |
- *data_size = (off_t)img->image_data_size; |
2190 |
- Ref<IOHandler> h(new MemIOHandler((void *)img->image_data_ptr, |
2191 |
|
2192 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1-thumbnail-locking.patch b/net-misc/mediatomb/files/mediatomb-0.12.1-thumbnail-locking.patch |
2193 |
deleted file mode 100644 |
2194 |
index 70658c495d2..00000000000 |
2195 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1-thumbnail-locking.patch |
2196 |
+++ /dev/null |
2197 |
@@ -1,71 +0,0 @@ |
2198 |
-if you try to generate a bunch of thumbnails at once, it can crash: |
2199 |
- |
2200 |
-Program received signal SIGABRT, Aborted. |
2201 |
-[Switching to Thread 0x7fdb7a6cb700 (LWP 17295)] |
2202 |
-0x00007fdb8031c899 in __GI_raise (sig=sig@entry=0x6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 |
2203 |
-56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. |
2204 |
-(gdb) bt |
2205 |
-#0 0x00007fdb8031c899 in __GI_raise (sig=sig@entry=0x6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 |
2206 |
-#1 0x00007fdb8031de27 in __GI_abort () at abort.c:89 |
2207 |
-#2 0x00007fdb7f6b9222 in ff_unlock_avcodec () at /var/tmp/portage/media-video/ffmpeg-1.2.6/work/ffmpeg-1.2.6/libavcodec/utils.c:2767 |
2208 |
-#3 0x00007fdb7f6b9662 in avcodec_open2 (avctx=0x7fdb64032080, codec=<optimized out>, options=0x0) at /var/tmp/portage/media-video/ffmpeg-1.2.6/work/ffmpeg-1.2.6/libavcodec/utils.c:1132 |
2209 |
-#4 0x00007fdb81be57bb in ffmpegthumbnailer::MovieDecoder::initializeVideo (this=this@entry=0x7fdb7a6ca000) at libffmpegthumbnailer/moviedecoder.cpp:176 |
2210 |
-#5 0x00007fdb81be599c in ffmpegthumbnailer::MovieDecoder::initialize (this=0x7fdb7a6ca000, filename=...) at libffmpegthumbnailer/moviedecoder.cpp:86 |
2211 |
-#6 0x00007fdb81be92cc in ffmpegthumbnailer::VideoThumbnailer::generateThumbnail (this=this@entry=0x7fdb6402af90, videoFile=..., imageWriter=..., pAvContext=pAvContext@entry=0x0) at libffmpegthumbnailer/videothumbnailer.cpp:118 |
2212 |
-#7 0x00007fdb81be97b4 in ffmpegthumbnailer::VideoThumbnailer::generateThumbnail (this=this@entry=0x7fdb6402af90, videoFile=..., type=<optimized out>, type@entry=Jpeg, buffer=..., pAvContext=pAvContext@entry=0x0) at libffmpegthumbnailer/videothumbnailer.cpp:191 |
2213 |
-#8 0x00007fdb81bea23e in video_thumbnailer_generate_thumbnail_to_buffer (thumbnailer=<optimized out>, movie_filename=0x7fdb7003abc0 "........mp4", generated_image_data=0x7fdb64022680) at libffmpegthumbnailer/videothumbnailerc.cpp:113 |
2214 |
-#9 0x00000000004ebfed in FfmpegHandler::serveContent (this=this@entry=0x7fdb64020ff0, item=..., resNum=resNum@entry=0x1, data_size=data_size@entry=0x7fdb7a6caaf0) at ../src/metadata/ffmpeg_handler.cc:475 |
2215 |
-#10 0x00000000004e48d7 in FileRequestHandler::open (this=<optimized out>, filename=<optimized out>, info=0x7fdb7a6caaf0, mode=<optimized out>) at ../src/file_request_handler.cc:575 |
2216 |
-#11 0x00000000004bba74 in web_open (filename=0x7fdb640175f0 "/content/media/object_id/16634/res_id/1/rh/6/ext/file.jpg", info=0x7fdb7a6caaf0, mode=UPNP_READ) at ../src/web_callbacks.cc:198 |
2217 |
-#12 0x000000000052674b in process_request (Fp=<synthetic pointer>, RespInstr=0x7fdb7a6cab70, alias=0x7fdb7a6cab20, filename=0x7fdb7a6caad0, headers=0x7fdb7a6caab0, rtype=<synthetic pointer>, req=0x7fdb7a6cacd0) at ../upnp/src/genlib/net/http/webserver.c:1343 |
2218 |
-#13 web_server_callback (parser=0x7fdb7a6cacd0, req=0x7fdb7a6cacd0, info=0x7fdb7a6cacc0) at ../upnp/src/genlib/net/http/webserver.c:1803 |
2219 |
-#14 0x000000000051f29a in dispatch_request (hparser=0x7fdb7a6cacd0, info=0x7fdb7a6cacc0) at ../upnp/src/genlib/miniserver/miniserver.c:236 |
2220 |
-#15 handle_request (args=0x7fdb6c000c40) at ../upnp/src/genlib/miniserver/miniserver.c:339 |
2221 |
-#16 0x000000000052cc66 in WorkerThread (arg=0x7a80e0 <gRecvThreadPool>) at ../threadutil/src/ThreadPool.c:594 |
2222 |
-#17 0x00007fdb80697333 in start_thread (arg=0x7fdb7a6cb700) at pthread_create.c:309 |
2223 |
-#18 0x00007fdb803d226d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111 |
2224 |
-(gdb) |
2225 |
- |
2226 |
---- a/src/metadata/ffmpeg_handler.cc |
2227 |
-+++ b/src/metadata/ffmpeg_handler.cc |
2228 |
-@@ -311,6 +311,10 @@ void FfmpegHandler::fillMetadata(Ref<CdsItem> item) |
2229 |
- |
2230 |
- #ifdef HAVE_FFMPEGTHUMBNAILER |
2231 |
- |
2232 |
-+// The ffmpegthumbnailer code (ffmpeg?) is not threading safe. |
2233 |
-+// Add a lock around the usage to avoid crashing randomly. |
2234 |
-+static pthread_mutex_t thumb_lock; |
2235 |
-+ |
2236 |
- static int _mkdir(const char *path) |
2237 |
- { |
2238 |
- int ret = mkdir(path, 0777); |
2239 |
-@@ -446,6 +450,9 @@ Ref<IOHandler> FfmpegHandler::serveContent(Ref<CdsItem> item, int resNum, off_t |
2240 |
- return h; |
2241 |
- } |
2242 |
- } |
2243 |
-+ |
2244 |
-+ pthread_mutex_lock(&thumb_lock); |
2245 |
-+ |
2246 |
- #ifdef FFMPEGTHUMBNAILER_OLD_API |
2247 |
- video_thumbnailer *th = create_thumbnailer(); |
2248 |
- image_data *img = create_image_data(); |
2249 |
-@@ -474,8 +481,11 @@ Ref<IOHandler> FfmpegHandler::serveContent(Ref<CdsItem> item, int resNum, off_t |
2250 |
- if (video_thumbnailer_generate_thumbnail_to_buffer(th, |
2251 |
- item->getLocation().c_str(), img) != 0) |
2252 |
- #endif // old api |
2253 |
-+ { |
2254 |
-+ pthread_mutex_unlock(&thumb_lock); |
2255 |
- throw _Exception(_("Could not generate thumbnail for ") + |
2256 |
- item->getLocation()); |
2257 |
-+ } |
2258 |
- if (cfg->getBoolOption(CFG_SERVER_EXTOPTS_FFMPEGTHUMBNAILER_CACHE_DIR_ENABLED)) { |
2259 |
- writeThumbnailCacheFile(item->getLocation(), |
2260 |
- img->image_data_ptr, img->image_data_size); |
2261 |
-@@ -491,6 +501,7 @@ Ref<IOHandler> FfmpegHandler::serveContent(Ref<CdsItem> item, int resNum, off_t |
2262 |
- video_thumbnailer_destroy_image_data(img); |
2263 |
- video_thumbnailer_destroy(th); |
2264 |
- #endif// old api |
2265 |
-+ pthread_mutex_unlock(&thumb_lock); |
2266 |
- return h; |
2267 |
- #else |
2268 |
- return nil; |
2269 |
|
2270 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1-time-t.patch b/net-misc/mediatomb/files/mediatomb-0.12.1-time-t.patch |
2271 |
deleted file mode 100644 |
2272 |
index 9961b5fede1..00000000000 |
2273 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1-time-t.patch |
2274 |
+++ /dev/null |
2275 |
@@ -1,56 +0,0 @@ |
2276 |
-From 73d12ad230a4ef4694f8d58b249ec6c2804ee324 Mon Sep 17 00:00:00 2001 |
2277 |
-From: Mike Frysinger <vapier@g.o> |
2278 |
-Date: Tue, 5 Apr 2016 22:56:27 -0400 |
2279 |
-Subject: [PATCH] fix storage quoting with long long values |
2280 |
- |
2281 |
-On 32-bit systems w/64-bit time_t's (like the x32 ABI) we fail to build: |
2282 |
-../src/storage/sql_storage.cc: In member function 'virtual void SQLStorage::autoscanUpdateLM(zmm::Ref<AutoscanDirectory>)': |
2283 |
-../src/storage/sql_storage.cc:2139:81: error: call of overloaded 'quote(time_t)' is ambiguous |
2284 |
- << " SET " << TQ("last_modified") << '=' << quote(adir->getPreviousLMT()) |
2285 |
- |
2286 |
-Handle long long types explicitly to fix that. |
2287 |
---- |
2288 |
- src/storage/mysql/mysql_storage.h | 1 + |
2289 |
- src/storage/sql_storage.h | 1 + |
2290 |
- src/storage/sqlite3/sqlite3_storage.h | 1 + |
2291 |
- 3 files changed, 3 insertions(+) |
2292 |
- |
2293 |
-diff --git a/src/storage/mysql/mysql_storage.h b/src/storage/mysql/mysql_storage.h |
2294 |
-index c377d76..eaec12c 100644 |
2295 |
---- a/src/storage/mysql/mysql_storage.h |
2296 |
-+++ b/src/storage/mysql/mysql_storage.h |
2297 |
-@@ -55,6 +55,7 @@ private: |
2298 |
- virtual inline zmm::String quote(unsigned long val) { return zmm::String::from(val); } |
2299 |
- virtual inline zmm::String quote(bool val) { return zmm::String(val ? '1' : '0'); } |
2300 |
- virtual inline zmm::String quote(char val) { return quote(zmm::String(val)); } |
2301 |
-+ virtual inline zmm::String quote(long long val) { return zmm::String::from(val); } |
2302 |
- virtual zmm::Ref<SQLResult> select(const char *query, int length); |
2303 |
- virtual int exec(const char *query, int length, bool getLastInsertId = false); |
2304 |
- virtual void storeInternalSetting(zmm::String key, zmm::String value); |
2305 |
-diff --git a/src/storage/sql_storage.h b/src/storage/sql_storage.h |
2306 |
-index 833693a..bd1afc3 100644 |
2307 |
---- a/src/storage/sql_storage.h |
2308 |
-+++ b/src/storage/sql_storage.h |
2309 |
-@@ -81,6 +81,7 @@ public: |
2310 |
- virtual zmm::String quote(unsigned long val) = 0; |
2311 |
- virtual zmm::String quote(bool val) = 0; |
2312 |
- virtual zmm::String quote(char val) = 0; |
2313 |
-+ virtual zmm::String quote(long long val) = 0; |
2314 |
- virtual zmm::Ref<SQLResult> select(const char *query, int length) = 0; |
2315 |
- virtual int exec(const char *query, int length, bool getLastInsertId = false) = 0; |
2316 |
- |
2317 |
-diff --git a/src/storage/sqlite3/sqlite3_storage.h b/src/storage/sqlite3/sqlite3_storage.h |
2318 |
-index d825bd4..be6294d 100644 |
2319 |
---- a/src/storage/sqlite3/sqlite3_storage.h |
2320 |
-+++ b/src/storage/sqlite3/sqlite3_storage.h |
2321 |
-@@ -160,6 +160,7 @@ private: |
2322 |
- virtual inline zmm::String quote(unsigned long val) { return zmm::String::from(val); } |
2323 |
- virtual inline zmm::String quote(bool val) { return zmm::String(val ? '1' : '0'); } |
2324 |
- virtual inline zmm::String quote(char val) { return quote(zmm::String(val)); } |
2325 |
-+ virtual inline zmm::String quote(long long val) { return zmm::String::from(val); } |
2326 |
- virtual zmm::Ref<SQLResult> select(const char *query, int length); |
2327 |
- virtual int exec(const char *query, int length, bool getLastInsertId = false); |
2328 |
- virtual void storeInternalSetting(zmm::String key, zmm::String value); |
2329 |
--- |
2330 |
-2.7.4 |
2331 |
- |
2332 |
|
2333 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1-youtube-dl.patch b/net-misc/mediatomb/files/mediatomb-0.12.1-youtube-dl.patch |
2334 |
deleted file mode 100644 |
2335 |
index 6001d2fc566..00000000000 |
2336 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1-youtube-dl.patch |
2337 |
+++ /dev/null |
2338 |
@@ -1,141 +0,0 @@ |
2339 |
---- mediatomb-0.12.1.orig/src/youtube_video_url.cc 2013-12-17 22:46:24.272442249 +0000 |
2340 |
-+++ mediatomb-0.12.1/src/youtube_video_url.cc 2013-12-17 22:57:25.968039083 +0000 |
2341 |
-@@ -117,89 +117,68 @@ String YouTubeVideoURL::getVideoURL(Stri |
2342 |
- |
2343 |
- watch = _(YOUTUBE_URL_WATCH) + video_id; |
2344 |
- |
2345 |
-- Ref<URL> url(new URL(YOUTUBE_PAGESIZE)); |
2346 |
-+ /* |
2347 |
-+ * NOTE ON PATCH: |
2348 |
-+ * |
2349 |
-+ * The original code does not seem to work anymore. |
2350 |
-+ * |
2351 |
-+ * I have commented-out all the original code, and instead |
2352 |
-+ * replaced it with a call/exec to youtube-dl (this is a separate/stand-alone python script). |
2353 |
-+ * |
2354 |
-+ * Available at http://rg3.github.io/youtube-dl/ |
2355 |
-+ * |
2356 |
-+ * |
2357 |
-+ * The current code works on a/my samsung TV. I have not tested it further on other devices. |
2358 |
-+ * (I needed a quick fix, because I wanted to watch some video's. :) ) |
2359 |
-+ * |
2360 |
-+ * I thought I would share the results. |
2361 |
-+ * |
2362 |
-+ * Suggestions / feedback -> bas-patch@×××××.nl |
2363 |
-+ * |
2364 |
-+ * Regards, Bas Nedermeijer |
2365 |
-+ */ |
2366 |
-+ |
2367 |
-+ int pipefd[2]; |
2368 |
-+ pipe(pipefd); |
2369 |
-+ |
2370 |
-+ if (fork() == 0) |
2371 |
-+ { |
2372 |
-+ // close reading end in the child |
2373 |
-+ close(pipefd[0]); |
2374 |
-+ |
2375 |
-+ // send stdout to the pipe |
2376 |
-+ dup2(pipefd[1], 1); |
2377 |
-+ // send stderr to the pipe |
2378 |
-+ dup2(pipefd[1], 2); |
2379 |
- |
2380 |
-- Ref<StringBuffer> buffer = url->download(watch, &retcode, curl_handle, |
2381 |
-- false, verbose, true); |
2382 |
-- if (retcode != 200) |
2383 |
-- { |
2384 |
-- throw _Exception(_("Failed to get URL for video with id ") |
2385 |
-- + watch + _("HTTP response code: ") + |
2386 |
-- String::from(retcode)); |
2387 |
-- } |
2388 |
-+ // this descriptor is no longer needed |
2389 |
-+ close(pipefd[1]); |
2390 |
- |
2391 |
-- log_debug("------> GOT BUFFER %s\n", buffer->toString().c_str()); |
2392 |
-- |
2393 |
-- Ref<Matcher> matcher = reVideoURLParams->matcher(buffer->toString()); |
2394 |
-- String params; |
2395 |
-- if (matcher->next()) |
2396 |
-- { |
2397 |
--// params = trim_string(matcher->group(1)); |
2398 |
-- params = trim_string( matcher->group( 0 ) ); |
2399 |
-- /* |
2400 |
-- int brace = params.index( '{' ); |
2401 |
-- if ( brace > 0 ) |
2402 |
-- params = params.substring( brace ); |
2403 |
-- brace = params.index( '}' ); |
2404 |
-- if ( brace > 0 ) |
2405 |
-- params = params.substring( 0, brace + 1 ); |
2406 |
-- */ |
2407 |
-- Ref<Matcher> m2 = param_t->matcher(params); |
2408 |
-- if (m2->next()) |
2409 |
-- { |
2410 |
-- String hmm = m2->group(1); |
2411 |
-- if (string_ok(hmm)) |
2412 |
-- params = hmm; |
2413 |
-- else |
2414 |
-- { |
2415 |
-- throw _Exception(_("Could not retrieve \"t\" parameter.")); |
2416 |
-- } |
2417 |
-- } |
2418 |
-+ // This code assumes youtube-dl is available for usage. |
2419 |
-+ execl("/usr/bin/youtube-dl", "/usr/bin/youtube-dl","-g",watch.c_str(),NULL); |
2420 |
- } |
2421 |
- else |
2422 |
- { |
2423 |
-- throw _Exception(_("Failed to get URL for video with id (step 1)") + video_id); |
2424 |
-- } |
2425 |
-+ // parent |
2426 |
-+ char buffery[8192]; |
2427 |
-+ memset(&buffery[0], 0, sizeof(buffery)); |
2428 |
- |
2429 |
-- params = _(YOUTUBE_URL_GET) + YOUTUBE_URL_PARAM_VIDEO_ID + '=' + |
2430 |
-- video_id + '&' + YOUTUBE_URL_PARAM_T + '=' + params; |
2431 |
-+ close(pipefd[1]); // close the write end of the pipe in the parent |
2432 |
- |
2433 |
-- if (mp4) |
2434 |
-- { |
2435 |
-- String format = _("&fmt=18"); |
2436 |
-- |
2437 |
-- if (hd) |
2438 |
-+ // Hopefully the read is never called twice, otherwise the buffer will become corrupt. |
2439 |
-+ while (read(pipefd[0], buffery, sizeof(buffery)) != 0) |
2440 |
- { |
2441 |
-- matcher = HD->matcher(buffer->toString()); |
2442 |
-- if (matcher->next()) |
2443 |
-- { |
2444 |
-- if (trim_string(matcher->group(1)) == "true") |
2445 |
-- format = _("&fmt=22"); |
2446 |
-- } |
2447 |
- } |
2448 |
-- |
2449 |
-- params = params + format; |
2450 |
-- } |
2451 |
- |
2452 |
-- buffer = url->download(params, &retcode, curl_handle, true, verbose, true); |
2453 |
-+ log_debug("------> GOT BUFFER %s\n", buffery); |
2454 |
-+ String result = _(buffery); |
2455 |
- |
2456 |
-- matcher = redirectLocation->matcher(buffer->toString()); |
2457 |
-- if (matcher->next()) |
2458 |
-- { |
2459 |
-- if (string_ok(trim_string(matcher->group(1)))) |
2460 |
-- return trim_string(matcher->group(1)); |
2461 |
-- else |
2462 |
-- throw _Exception(_("Failed to get URL for video with id (step 2)")+ |
2463 |
-- video_id); |
2464 |
-- } |
2465 |
-+ result = trim_string(result); |
2466 |
- |
2467 |
-- if (retcode != 303) |
2468 |
-- { |
2469 |
-- throw _Exception(_("Unexpected reply from YouTube: ") + |
2470 |
-- String::from(retcode)); |
2471 |
-- } |
2472 |
-+ log_debug("------> GOT BUFFER (after trimming) %s\n", result.c_str()); |
2473 |
- |
2474 |
-- throw _Exception(_("Could not retrieve YouTube video URL")); |
2475 |
-+ return result; |
2476 |
-+ } |
2477 |
- } |
2478 |
- |
2479 |
- #endif//YOUTUBE |
2480 |
|
2481 |
diff --git a/net-misc/mediatomb/files/mediatomb-0.12.1.initd b/net-misc/mediatomb/files/mediatomb-0.12.1.initd |
2482 |
deleted file mode 100644 |
2483 |
index 6c7989d89d6..00000000000 |
2484 |
--- a/net-misc/mediatomb/files/mediatomb-0.12.1.initd |
2485 |
+++ /dev/null |
2486 |
@@ -1,28 +0,0 @@ |
2487 |
-#!/sbin/openrc-run |
2488 |
-# Copyright 1999-2012 Gentoo Foundation |
2489 |
-# Distributed under the terms of the GNU General Public License v2 |
2490 |
- |
2491 |
-depend() { |
2492 |
- need net |
2493 |
- # In order to properly support this (need vs use), we would have to |
2494 |
- # parse ${MEDIATOMB_CONFIG} and see if mysql is enabled and if it is |
2495 |
- # pointing to the local system. #368409 |
2496 |
- use mysql |
2497 |
-} |
2498 |
- |
2499 |
-start() { |
2500 |
- ebegin "Starting MediaTomb" |
2501 |
- start-stop-daemon --start --quiet --exec /usr/bin/mediatomb \ |
2502 |
- --pidfile ${MEDIATOMB_PIDFILE} -- --daemon \ |
2503 |
- --pidfile ${MEDIATOMB_PIDFILE} --user ${MEDIATOMB_USER} \ |
2504 |
- --group ${MEDIATOMB_GROUP} --logfile ${MEDIATOMB_LOGFILE} \ |
2505 |
- --config ${MEDIATOMB_CONFIG} --port ${MEDIATOMB_PORT} \ |
2506 |
- ${MEDIATOMB_OPTIONS} |
2507 |
- eend $? |
2508 |
-} |
2509 |
- |
2510 |
-stop () { |
2511 |
- ebegin "Stopping MediaTomb" |
2512 |
- start-stop-daemon --stop --retry 10 --quiet --pidfile ${MEDIATOMB_PIDFILE} |
2513 |
- eend $? |
2514 |
-} |
2515 |
|
2516 |
diff --git a/net-misc/mediatomb/mediatomb-0.12.1-r8.ebuild b/net-misc/mediatomb/mediatomb-0.12.1-r8.ebuild |
2517 |
deleted file mode 100644 |
2518 |
index dbd67789311..00000000000 |
2519 |
--- a/net-misc/mediatomb/mediatomb-0.12.1-r8.ebuild |
2520 |
+++ /dev/null |
2521 |
@@ -1,158 +0,0 @@ |
2522 |
-# Copyright 1999-2014 Gentoo Foundation |
2523 |
-# Distributed under the terms of the GNU General Public License v2 |
2524 |
- |
2525 |
-EAPI=5 |
2526 |
-inherit autotools eutils linux-info user |
2527 |
- |
2528 |
-DEB_VER="5" |
2529 |
-DESCRIPTION="MediaTomb is an open source UPnP MediaServer" |
2530 |
-HOMEPAGE="http://www.mediatomb.cc/" |
2531 |
- |
2532 |
-SRC_URI="mirror://sourceforge/mediatomb/${P}.tar.gz |
2533 |
- mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}-${DEB_VER}.debian.tar.gz" |
2534 |
- |
2535 |
-LICENSE="GPL-2" |
2536 |
-SLOT="0" |
2537 |
-KEYWORDS="amd64 ~arm ~ppc x86" |
2538 |
- |
2539 |
-IUSE="curl debug +exif +ffmpeg flac id3tag +inotify +javascript lastfm |
2540 |
- libextractor +magic +mp4 mysql +sqlite +taglib thumbnail +zlib" |
2541 |
-REQUIRED_USE=" |
2542 |
- || ( mysql sqlite ) |
2543 |
- taglib? ( !id3tag ) |
2544 |
- id3tag? ( !taglib ) |
2545 |
- thumbnail? ( ffmpeg !libextractor ) |
2546 |
- ffmpeg? ( !libextractor ) |
2547 |
- libextractor? ( !ffmpeg !thumbnail ) |
2548 |
-" |
2549 |
- |
2550 |
-DEPEND="mysql? ( virtual/mysql ) |
2551 |
- dev-libs/expat |
2552 |
- id3tag? ( media-libs/id3lib ) |
2553 |
- javascript? ( >=dev-lang/spidermonkey-1.8.5:0 ) |
2554 |
- taglib? ( media-libs/taglib ) |
2555 |
- sqlite? ( >=dev-db/sqlite-3 ) |
2556 |
- lastfm? ( >=media-libs/lastfmlib-0.4 ) |
2557 |
- exif? ( media-libs/libexif ) |
2558 |
- libextractor? ( media-libs/libextractor ) |
2559 |
- mp4? ( >=media-libs/libmp4v2-1.9.1_p479:0 ) |
2560 |
- ffmpeg? ( virtual/ffmpeg ) |
2561 |
- flac? ( media-libs/flac ) |
2562 |
- thumbnail? ( media-video/ffmpegthumbnailer[jpeg] ) |
2563 |
- curl? ( net-misc/curl net-misc/youtube-dl ) |
2564 |
- magic? ( sys-apps/file ) |
2565 |
- sys-apps/util-linux |
2566 |
- zlib? ( sys-libs/zlib ) |
2567 |
- virtual/libiconv |
2568 |
-" |
2569 |
-RDEPEND="${DEPEND}" |
2570 |
- |
2571 |
-CONFIG_CHECK="~INOTIFY_USER" |
2572 |
- |
2573 |
-pkg_setup() { |
2574 |
- enewgroup mediatomb |
2575 |
- enewuser mediatomb -1 -1 /dev/null mediatomb |
2576 |
-} |
2577 |
- |
2578 |
-src_prepare() { |
2579 |
- # Apply Debians patchset |
2580 |
- local p dd="${WORKDIR}"/debian/patches |
2581 |
- sed -i -r '/^[-+]{3} /s:[.][.]/::' "${dd}"/* || die |
2582 |
- # We use our version as it seems to be more complete. |
2583 |
- sed -i '/^0010_fix_libmp4v2_build.patch/d' "${dd}"/series || die |
2584 |
- for p in $(<"${dd}"/series) ; do |
2585 |
- epatch "${dd}"/${p} |
2586 |
- done |
2587 |
- |
2588 |
- # libmp4v2 API breakage #410235 |
2589 |
- epatch "${FILESDIR}"/${P}-libmp4v2.patch |
2590 |
- |
2591 |
- # Use system libuuid #270830 |
2592 |
- epatch "${FILESDIR}"/${P}-system-uuid.patch |
2593 |
- |
2594 |
- # Support spidermonkey-187 #423991 #482392 |
2595 |
- if has_version "~dev-lang/spidermonkey-1.8.7" ; then |
2596 |
- epatch "${FILESDIR}"/${P}-mozjs187.patch |
2597 |
- fi |
2598 |
- |
2599 |
- # Support libextractor-0.6.0 #435394 |
2600 |
- epatch "${FILESDIR}"/${P}-libextractor.patch |
2601 |
- |
2602 |
- # Fix inotify and hard links |
2603 |
- epatch "${FILESDIR}"/${P}-inotify-hard-links.patch |
2604 |
- |
2605 |
- # Add support for caching thumbnails |
2606 |
- epatch "${FILESDIR}"/${P}-thumb-cache.patch |
2607 |
- epatch "${FILESDIR}"/${P}-thumbnail-locking.patch |
2608 |
- |
2609 |
- # Respect AR #464710 |
2610 |
- epatch "${FILESDIR}"/${P}-system-ar.patch |
2611 |
- |
2612 |
- # Add flac metadata support #494398 |
2613 |
- epatch "${FILESDIR}"/${P}-flac-metadata.patch |
2614 |
- |
2615 |
- # Work around broken youtube support by using youtube-dl #467110 |
2616 |
- epatch "${FILESDIR}"/${P}-youtube-dl.patch |
2617 |
- |
2618 |
- epatch "${FILESDIR}"/${P}-time-t.patch |
2619 |
- |
2620 |
- epatch_user |
2621 |
- |
2622 |
- eautoreconf |
2623 |
-} |
2624 |
- |
2625 |
-src_configure() { |
2626 |
- econf \ |
2627 |
- $(use_enable curl) \ |
2628 |
- $(use_enable curl youtube) \ |
2629 |
- $(use_enable debug tombdebug) \ |
2630 |
- $(use_enable exif libexif) \ |
2631 |
- $(use_enable ffmpeg) \ |
2632 |
- $(use_enable flac FLAC) \ |
2633 |
- $(use_enable id3tag id3lib) \ |
2634 |
- $(use_enable inotify) \ |
2635 |
- $(use_enable javascript libjs) \ |
2636 |
- $(use_enable lastfm lastfmlib) \ |
2637 |
- $(use_enable libextractor) \ |
2638 |
- $(use_enable magic libmagic) \ |
2639 |
- $(use_enable mp4 libmp4v2) \ |
2640 |
- $(use_enable mysql) \ |
2641 |
- $(use_enable sqlite sqlite3) \ |
2642 |
- $(use_enable taglib) \ |
2643 |
- $(use_enable thumbnail ffmpegthumbnailer) \ |
2644 |
- $(use_enable zlib) \ |
2645 |
- --enable-external-transcoding \ |
2646 |
- --enable-protocolinfo-extension |
2647 |
-} |
2648 |
- |
2649 |
-src_install() { |
2650 |
- default |
2651 |
- |
2652 |
- newinitd "${FILESDIR}"/${PN}-0.12.1.initd ${PN} |
2653 |
- use mysql || sed -i -e "/use mysql/d" "${ED}"/etc/init.d/${PN} |
2654 |
- newconfd "${FILESDIR}"/${PN}-0.12.0.confd ${PN} |
2655 |
- |
2656 |
- insinto /etc/mediatomb |
2657 |
- newins "${FILESDIR}/${PN}-0.12.0.config" config.xml |
2658 |
- fperms 0600 /etc/mediatomb/config.xml |
2659 |
- fowners mediatomb:mediatomb /etc/mediatomb/config.xml |
2660 |
- |
2661 |
- keepdir /var/lib/mediatomb |
2662 |
- fowners mediatomb:mediatomb /var/lib/mediatomb |
2663 |
-} |
2664 |
- |
2665 |
-pkg_postinst() { |
2666 |
- if use mysql ; then |
2667 |
- elog "MediaTomb has been built with MySQL support and needs" |
2668 |
- elog "to be configured before being started." |
2669 |
- elog "For more information, please consult the MediaTomb" |
2670 |
- elog "documentation: http://mediatomb.cc/pages/documentation" |
2671 |
- elog |
2672 |
- fi |
2673 |
- |
2674 |
- elog "To configure MediaTomb edit:" |
2675 |
- elog "/etc/mediatomb/config.xml" |
2676 |
- elog |
2677 |
- elog "The MediaTomb web interface can be reached at (after the service is started):" |
2678 |
- elog "http://localhost:49152/" |
2679 |
-} |
2680 |
|
2681 |
diff --git a/net-misc/mediatomb/mediatomb-0.12.2_pre20160522.ebuild b/net-misc/mediatomb/mediatomb-0.12.2_pre20160522.ebuild |
2682 |
deleted file mode 100644 |
2683 |
index 3640a7bd24b..00000000000 |
2684 |
--- a/net-misc/mediatomb/mediatomb-0.12.2_pre20160522.ebuild |
2685 |
+++ /dev/null |
2686 |
@@ -1,122 +0,0 @@ |
2687 |
-# Copyright 1999-2016 Gentoo Foundation |
2688 |
-# Distributed under the terms of the GNU General Public License v2 |
2689 |
- |
2690 |
-EAPI=5 |
2691 |
-inherit autotools eutils linux-info systemd user vcs-snapshot |
2692 |
- |
2693 |
-DESCRIPTION="MediaTomb is an open source UPnP MediaServer" |
2694 |
-HOMEPAGE="http://www.mediatomb.cc/" |
2695 |
-SRC_URI="https://github.com/v00d00/${PN}/archive/${P}.tar.gz" |
2696 |
- |
2697 |
-LICENSE="GPL-2" |
2698 |
-SLOT="0" |
2699 |
-KEYWORDS="~amd64 ~arm ~x86" |
2700 |
- |
2701 |
-IUSE="curl debug +exif +ffmpeg flac id3tag +inotify +javascript lastfm |
2702 |
- libav +magic +mp4 mysql +sqlite +taglib thumbnail +zlib" |
2703 |
-REQUIRED_USE=" |
2704 |
- || ( mysql sqlite ) |
2705 |
- taglib? ( !id3tag ) |
2706 |
- id3tag? ( !taglib ) |
2707 |
- thumbnail? ( ffmpeg ) |
2708 |
-" |
2709 |
- |
2710 |
-DEPEND="mysql? ( virtual/mysql ) |
2711 |
- dev-libs/expat |
2712 |
- id3tag? ( media-libs/id3lib ) |
2713 |
- javascript? ( >=dev-lang/spidermonkey-1.8.5:0 ) |
2714 |
- taglib? ( media-libs/taglib ) |
2715 |
- sqlite? ( >=dev-db/sqlite-3 ) |
2716 |
- lastfm? ( >=media-libs/lastfmlib-0.4 ) |
2717 |
- exif? ( media-libs/libexif ) |
2718 |
- mp4? ( >=media-libs/libmp4v2-1.9.1_p479:0 ) |
2719 |
- ffmpeg? ( |
2720 |
- libav? ( >=media-video/libav-10:0= ) |
2721 |
- !libav? ( >=media-video/ffmpeg-2.2:0= ) |
2722 |
- ) |
2723 |
- flac? ( media-libs/flac ) |
2724 |
- thumbnail? ( media-video/ffmpegthumbnailer[jpeg] ) |
2725 |
- curl? ( net-misc/curl net-misc/youtube-dl ) |
2726 |
- magic? ( sys-apps/file ) |
2727 |
- sys-apps/util-linux |
2728 |
- zlib? ( sys-libs/zlib ) |
2729 |
- virtual/libiconv |
2730 |
-" |
2731 |
-RDEPEND="${DEPEND}" |
2732 |
- |
2733 |
-CONFIG_CHECK="~INOTIFY_USER" |
2734 |
- |
2735 |
-pkg_setup() { |
2736 |
- use inotify && linux-info_pkg_setup |
2737 |
- |
2738 |
- enewgroup mediatomb |
2739 |
- enewuser mediatomb -1 -1 /dev/null mediatomb |
2740 |
-} |
2741 |
- |
2742 |
-src_prepare() { |
2743 |
- # Support spidermonkey-187 #423991 #482392 |
2744 |
- if has_version "~dev-lang/spidermonkey-1.8.7" ; then |
2745 |
- epatch "${FILESDIR}"/${PN}-0.12.1-mozjs187.patch |
2746 |
- fi |
2747 |
- |
2748 |
- epatch_user |
2749 |
- |
2750 |
- eautoreconf |
2751 |
-} |
2752 |
- |
2753 |
-src_configure() { |
2754 |
- econf \ |
2755 |
- $(use_enable curl) \ |
2756 |
- $(use_enable curl youtube) \ |
2757 |
- $(use_enable debug tombdebug) \ |
2758 |
- $(use_enable exif libexif) \ |
2759 |
- $(use_enable ffmpeg) \ |
2760 |
- $(use_enable flac) \ |
2761 |
- $(use_enable id3tag id3lib) \ |
2762 |
- $(use_enable inotify) \ |
2763 |
- $(use_enable javascript libjs) \ |
2764 |
- $(use_enable lastfm lastfm) \ |
2765 |
- $(use_enable magic libmagic) \ |
2766 |
- $(use_enable mp4 libmp4v2) \ |
2767 |
- $(use_enable mysql) \ |
2768 |
- $(use_enable sqlite sqlite3) \ |
2769 |
- $(use_enable taglib) \ |
2770 |
- $(use_enable thumbnail ffmpegthumbnailer) \ |
2771 |
- --enable-external-transcoding \ |
2772 |
- --enable-protocolinfo-extension |
2773 |
-} |
2774 |
- |
2775 |
-src_install() { |
2776 |
- default |
2777 |
- |
2778 |
- systemd_dounit "${S}"/scripts/systemd/"${PN}".service |
2779 |
- use mysql && systemd_dounit "${S}"/scripts/systemd/"${PN}"-mysql.service |
2780 |
- |
2781 |
- newinitd "${FILESDIR}"/${PN}-0.12.1.initd ${PN} |
2782 |
- use mysql || sed -i -e "/use mysql/d" "${ED}"/etc/init.d/${PN} |
2783 |
- newconfd "${FILESDIR}"/${PN}-0.12.0.confd ${PN} |
2784 |
- |
2785 |
- insinto /etc/mediatomb |
2786 |
- newins "${FILESDIR}/${PN}-0.12.0.config" config.xml |
2787 |
- fperms 0600 /etc/mediatomb/config.xml |
2788 |
- fowners mediatomb:mediatomb /etc/mediatomb/config.xml |
2789 |
- |
2790 |
- keepdir /var/lib/mediatomb |
2791 |
- fowners mediatomb:mediatomb /var/lib/mediatomb |
2792 |
-} |
2793 |
- |
2794 |
-pkg_postinst() { |
2795 |
- if use mysql ; then |
2796 |
- elog "MediaTomb has been built with MySQL support and needs" |
2797 |
- elog "to be configured before being started." |
2798 |
- elog "For more information, please consult the MediaTomb" |
2799 |
- elog "documentation: http://mediatomb.cc/pages/documentation" |
2800 |
- elog |
2801 |
- fi |
2802 |
- |
2803 |
- elog "To configure MediaTomb edit:" |
2804 |
- elog "/etc/mediatomb/config.xml" |
2805 |
- elog |
2806 |
- elog "The MediaTomb web interface can be reached at (after the service is started):" |
2807 |
- elog "http://localhost:49152/" |
2808 |
-} |
2809 |
|
2810 |
diff --git a/net-misc/mediatomb/metadata.xml b/net-misc/mediatomb/metadata.xml |
2811 |
deleted file mode 100644 |
2812 |
index f4913582570..00000000000 |
2813 |
--- a/net-misc/mediatomb/metadata.xml |
2814 |
+++ /dev/null |
2815 |
@@ -1,28 +0,0 @@ |
2816 |
-<?xml version="1.0" encoding="UTF-8"?> |
2817 |
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
2818 |
-<pkgmetadata> |
2819 |
- <maintainer type="person"> |
2820 |
- <email>thev00d00@g.o</email> |
2821 |
- <name>Ian Whyman</name> |
2822 |
- </maintainer> |
2823 |
- <maintainer type="project"> |
2824 |
- <email>media-video@g.o</email> |
2825 |
- <name>Gentoo Video project</name> |
2826 |
- </maintainer> |
2827 |
- <use> |
2828 |
- <flag name="curl">Support YouTube and external media sources (e.g. internet radio)</flag> |
2829 |
- <flag name="flac">Enable FLAC metadata/artwork support</flag> |
2830 |
- <flag name="id3tag">Use <pkg>media-libs/libid3tag</pkg> for reading files' metadata rather than taglib</flag> |
2831 |
- <flag name="inotify">Enable inotify filesystem monitoring support</flag> |
2832 |
- <flag name="lastfm">Enable last.fm support</flag> |
2833 |
- <flag name="libextractor">Use libextractor to gather files' metadata</flag> |
2834 |
- <flag name="magic">Use libmagic to determine file types</flag> |
2835 |
- <flag name="mysql">Use <pkg>dev-db/mysql</pkg> as backend rather than SQLite3</flag> |
2836 |
- <flag name="taglib">Use <pkg>media-libs/taglib</pkg> for reading files' metadata rather than id3lib</flag> |
2837 |
- <flag name="thumbnail">Enables video thumbnails generation through <pkg>media-video/ffmpegthumbnailer</pkg></flag> |
2838 |
- </use> |
2839 |
- <upstream> |
2840 |
- <remote-id type="github">v00d00/mediatomb</remote-id> |
2841 |
- <remote-id type="sourceforge">mediatomb</remote-id> |
2842 |
- </upstream> |
2843 |
-</pkgmetadata> |