summaryrefslogtreecommitdiff
path: root/multimedia
diff options
context:
space:
mode:
authorryoon <ryoon@pkgsrc.org>2012-09-25 11:45:11 +0000
committerryoon <ryoon@pkgsrc.org>2012-09-25 11:45:11 +0000
commit84c172af9c23ce891117e8b9b68677a5a3e2d40e (patch)
tree990b17de465b6ccb13534f0d1269fa2f95c0d1ef /multimedia
parented6ac3f9ca2b87e7f6bc5b9063560f9ee63ae199 (diff)
downloadpkgsrc-84c172af9c23ce891117e8b9b68677a5a3e2d40e.tar.gz
Fix build on NetBSD current, at least.
* Fix build with recent ffmpeg * Add SONY Bravia support to check functionality
Diffstat (limited to 'multimedia')
-rw-r--r--multimedia/mediatomb/distinfo32
-rw-r--r--multimedia/mediatomb/patches/patch-aa8
-rw-r--r--multimedia/mediatomb/patches/patch-ab6
-rw-r--r--multimedia/mediatomb/patches/patch-af6
-rw-r--r--multimedia/mediatomb/patches/patch-ag4
-rw-r--r--multimedia/mediatomb/patches/patch-ba4
-rw-r--r--multimedia/mediatomb/patches/patch-bb4
-rw-r--r--multimedia/mediatomb/patches/patch-bc4
-rw-r--r--multimedia/mediatomb/patches/patch-src_cds__resource__manager.cc37
-rw-r--r--multimedia/mediatomb/patches/patch-src_common.h15
-rw-r--r--multimedia/mediatomb/patches/patch-src_hash_dbo_hash.h4
-rw-r--r--multimedia/mediatomb/patches/patch-src_hash_dbr_hash.h4
-rw-r--r--multimedia/mediatomb/patches/patch-src_hash_dso_hash.h4
-rw-r--r--multimedia/mediatomb/patches/patch-src_io__handler__buffer__helper.cc15
-rw-r--r--multimedia/mediatomb/patches/patch-src_metadata_ffmpeg__handler.cc94
-rw-r--r--multimedia/mediatomb/patches/patch-src_tools.cc50
-rw-r--r--multimedia/mediatomb/patches/patch-src_transcoding_transcode__ext__handler.cc16
-rw-r--r--multimedia/mediatomb/patches/patch-src_upnp__xml.cc29
-rw-r--r--multimedia/mediatomb/patches/patch-src_youtube__video__url.cc13
-rw-r--r--multimedia/mediatomb/patches/patch-tombupnp_upnp_src_genlib_net_http_webserver.c4
20 files changed, 315 insertions, 38 deletions
diff --git a/multimedia/mediatomb/distinfo b/multimedia/mediatomb/distinfo
index c1d2f4da564..77fc734ea0d 100644
--- a/multimedia/mediatomb/distinfo
+++ b/multimedia/mediatomb/distinfo
@@ -1,17 +1,25 @@
-$NetBSD: distinfo,v 1.10 2011/09/24 22:33:25 tron Exp $
+$NetBSD: distinfo,v 1.11 2012/09/25 11:45:11 ryoon Exp $
SHA1 (mediatomb-0.12.1.tar.gz) = 86e880584cc9c8aaf3926d56048510d1d06e76b4
RMD160 (mediatomb-0.12.1.tar.gz) = ecb61ca2483f76421beef1036ac442b8f805fa96
Size (mediatomb-0.12.1.tar.gz) = 1240612 bytes
-SHA1 (patch-aa) = 09eefa3d86e40a5e7364f3b8b9a224ad3b8cf8b6
-SHA1 (patch-ab) = d79db20a98084e2297534d09ede39dd0141a600c
-SHA1 (patch-af) = ec9261d2ec645a07144f8b927fd57a50175903ca
-SHA1 (patch-ag) = 4ceebfca5a1f0556b71bee4713cb35726208f27e
-SHA1 (patch-ba) = ff31a77e71b772be945441d3c9219cd199f5ff83
-SHA1 (patch-bb) = 27661c4d0e841b6da8b280a3cbac3c38f581b2df
-SHA1 (patch-bc) = 40ef84ec5802431c5f2a811a5bf53a76d15c3904
-SHA1 (patch-src_hash_dbo_hash.h) = 77ecff9c2cc5ef940c3bc1e3e8b5c0aad7b7f690
-SHA1 (patch-src_hash_dbr_hash.h) = a57f155ffe43ff8615706b76718a835590999375
-SHA1 (patch-src_hash_dso_hash.h) = 50e0ce32e58e9d2122bed4db3509fa1f53c12945
+SHA1 (patch-aa) = d4d5964d6bbe76e470a75ffa5b81048ffaf6cb63
+SHA1 (patch-ab) = 3bc30de7f20c9468489453de95db28ec2192e2bb
+SHA1 (patch-af) = aab0d775169c886b58c1fc72489437341c4c25e7
+SHA1 (patch-ag) = 601d239d5a9ec51a63be6ecfa762c2598f8ecf5e
+SHA1 (patch-ba) = 1c2af26e7a6e72f5b82d9b29785b73615d5042a3
+SHA1 (patch-bb) = e36d15a71f463935111543f90dc0787b4a66da5d
+SHA1 (patch-bc) = c02375ac835203ba147f3d0347ff2ff0abe3bf13
+SHA1 (patch-src_cds__resource__manager.cc) = 1f537f1f29a19fd7ad082195cd090d6cf0a59abd
+SHA1 (patch-src_common.h) = c18747685996693d7aa653e1aa9041f0d774ee9d
+SHA1 (patch-src_hash_dbo_hash.h) = a5d951dc6887273188b3d41b8076000857b92431
+SHA1 (patch-src_hash_dbr_hash.h) = e98a4ce19f25f7e556c2c13e170aee21e57fc5cc
+SHA1 (patch-src_hash_dso_hash.h) = c229373ea25b4c49708cb2d8555a9e13f5d8bb4f
+SHA1 (patch-src_io__handler__buffer__helper.cc) = f1c88fab9379c322492ebf27840c20689bd8ac76
+SHA1 (patch-src_metadata_ffmpeg__handler.cc) = b343d3e065e506423872e32f35ae792306f2b50a
+SHA1 (patch-src_tools.cc) = dddb50c51786cbb6a7c77ff5e60c22c3a57dc0fa
+SHA1 (patch-src_transcoding_transcode__ext__handler.cc) = 6fe899f6b40de69561f568e1f976f6994e029260
+SHA1 (patch-src_upnp__xml.cc) = 843e92c3a186c83920512ff6b7f37ba006defc21
+SHA1 (patch-src_youtube__video__url.cc) = 0a739441ad4fb2db5d9f43c5ea3870e2839b6677
SHA1 (patch-tombupnp_threadutil_src_ThreadPool.c) = 152fd5284382bfbdfe489945dd1e843fa38d5b02
-SHA1 (patch-tombupnp_upnp_src_genlib_net_http_webserver.c) = 671753a05d221370981e9ee6fdc1d896cadf2836
+SHA1 (patch-tombupnp_upnp_src_genlib_net_http_webserver.c) = c378cad0fefe08223b14672df432844ab94c4c7a
diff --git a/multimedia/mediatomb/patches/patch-aa b/multimedia/mediatomb/patches/patch-aa
index 0b8769a1d1f..d424cf6793f 100644
--- a/multimedia/mediatomb/patches/patch-aa
+++ b/multimedia/mediatomb/patches/patch-aa
@@ -1,12 +1,12 @@
-$NetBSD: patch-aa,v 1.3 2011/09/24 22:33:25 tron Exp $
+$NetBSD: patch-aa,v 1.4 2012/09/25 11:45:11 ryoon Exp $
Avoid dependence on "liblwres". Based on this patch for "pupnp":
http://pupnp.git.sourceforge.net/git/gitweb.cgi?p=pupnp/pupnp;a=commitdiff;h=5151d4520308f59c71764423c3853a35cf23e279#patch9
---- configure.ac.orig 2010-04-07 23:38:51.000000000 +0100
-+++ configure.ac 2011-09-24 23:03:42.000000000 +0100
-@@ -696,20 +696,23 @@
+--- configure.ac.orig 2010-04-07 22:38:51.000000000 +0000
++++ configure.ac
+@@ -696,20 +696,23 @@ fi
AC_CHECK_FUNCS([gethostbyname_r],[],
[
diff --git a/multimedia/mediatomb/patches/patch-ab b/multimedia/mediatomb/patches/patch-ab
index b75cb8b3a57..6b0d8c1f1b1 100644
--- a/multimedia/mediatomb/patches/patch-ab
+++ b/multimedia/mediatomb/patches/patch-ab
@@ -1,12 +1,12 @@
-$NetBSD: patch-ab,v 1.3 2011/09/24 22:33:25 tron Exp $
+$NetBSD: patch-ab,v 1.4 2012/09/25 11:45:11 ryoon Exp $
Avoid dependence on "liblwres". Based on this patch for "pupnp":
http://pupnp.git.sourceforge.net/git/gitweb.cgi?p=pupnp/pupnp;a=commitdiff;h=5151d4520308f59c71764423c3853a35cf23e279#patch9
--- tombupnp/upnp/src/genlib/net/uri/uri.c.orig 2010-03-25 14:58:12.000000000 +0000
-+++ tombupnp/upnp/src/genlib/net/uri/uri.c 2011-09-24 23:06:10.000000000 +0100
-@@ -657,11 +657,38 @@
++++ tombupnp/upnp/src/genlib/net/uri/uri.c
+@@ -657,11 +657,38 @@ parse_hostport( const char *in,
if ( h == NULL ) {
errCode = 1;
}
diff --git a/multimedia/mediatomb/patches/patch-af b/multimedia/mediatomb/patches/patch-af
index 1eed42e7903..b44e3efedf2 100644
--- a/multimedia/mediatomb/patches/patch-af
+++ b/multimedia/mediatomb/patches/patch-af
@@ -1,7 +1,7 @@
-$NetBSD: patch-af,v 1.1 2008/04/11 10:11:59 agc Exp $
+$NetBSD: patch-af,v 1.2 2012/09/25 11:45:11 ryoon Exp $
---- config/mappings.xml 2008/04/11 09:24:50 1.1
-+++ config/mappings.xml 2008/04/11 09:25:38
+--- config/mappings.xml.orig 2010-03-22 10:39:50.000000000 +0000
++++ config/mappings.xml
@@ -13,6 +13,7 @@
<map from="m3u" to="audio/x-mpegurl"/>
<map from="pls" to="audio/x-scpls"/>
diff --git a/multimedia/mediatomb/patches/patch-ag b/multimedia/mediatomb/patches/patch-ag
index b2c830786d3..c2fcb01503c 100644
--- a/multimedia/mediatomb/patches/patch-ag
+++ b/multimedia/mediatomb/patches/patch-ag
@@ -1,6 +1,6 @@
-$NetBSD: patch-ag,v 1.2 2010/11/27 06:30:24 agc Exp $
+$NetBSD: patch-ag,v 1.3 2012/09/25 11:45:11 ryoon Exp $
---- src/config_manager.cc.orig 2010-10-02 22:05:12.000000000 +0000
+--- src/config_manager.cc.orig 2010-03-25 14:58:11.000000000 +0000
+++ src/config_manager.cc
@@ -576,6 +576,7 @@ String ConfigManager::createDefaultConfi
Ref<Element> ext2mt(new Element(_("extension-mimetype")));
diff --git a/multimedia/mediatomb/patches/patch-ba b/multimedia/mediatomb/patches/patch-ba
index 8781b4fbd50..d9861c1b340 100644
--- a/multimedia/mediatomb/patches/patch-ba
+++ b/multimedia/mediatomb/patches/patch-ba
@@ -1,6 +1,6 @@
-$NetBSD: patch-ba,v 1.2 2010/11/27 06:30:24 agc Exp $
+$NetBSD: patch-ba,v 1.3 2012/09/25 11:45:11 ryoon Exp $
---- src/storage/sql_storage.h.orig 2010-10-02 22:07:24.000000000 +0000
+--- src/storage/sql_storage.h.orig 2010-03-25 14:58:06.000000000 +0000
+++ src/storage/sql_storage.h
@@ -79,6 +79,7 @@ public:
virtual zmm::String quote(unsigned int val) = 0;
diff --git a/multimedia/mediatomb/patches/patch-bb b/multimedia/mediatomb/patches/patch-bb
index 5fc8d170a9c..045977891b8 100644
--- a/multimedia/mediatomb/patches/patch-bb
+++ b/multimedia/mediatomb/patches/patch-bb
@@ -1,6 +1,6 @@
-$NetBSD: patch-bb,v 1.2 2010/11/27 06:30:24 agc Exp $
+$NetBSD: patch-bb,v 1.3 2012/09/25 11:45:11 ryoon Exp $
---- src/storage/sqlite3/sqlite3_storage.h.orig 2010-10-02 22:09:43.000000000 +0000
+--- src/storage/sqlite3/sqlite3_storage.h.orig 2010-03-25 14:58:06.000000000 +0000
+++ src/storage/sqlite3/sqlite3_storage.h
@@ -158,6 +158,7 @@ private:
virtual inline zmm::String quote(unsigned int val) { return zmm::String::from(val); }
diff --git a/multimedia/mediatomb/patches/patch-bc b/multimedia/mediatomb/patches/patch-bc
index 4f5773fa6b9..30eff9b7ef3 100644
--- a/multimedia/mediatomb/patches/patch-bc
+++ b/multimedia/mediatomb/patches/patch-bc
@@ -1,6 +1,6 @@
-$NetBSD: patch-bc,v 1.2 2010/11/27 06:30:24 agc Exp $
+$NetBSD: patch-bc,v 1.3 2012/09/25 11:45:11 ryoon Exp $
---- src/storage/sql_storage.cc.orig 2010-10-02 22:11:55.000000000 +0000
+--- src/storage/sql_storage.cc.orig 2010-03-25 15:28:10.000000000 +0000
+++ src/storage/sql_storage.cc
@@ -2133,7 +2133,7 @@ void SQLStorage::autoscanUpdateLM(Ref<Au
throw _Exception(_("autoscanUpdateLM called with adir with illegal objectID and location"));
diff --git a/multimedia/mediatomb/patches/patch-src_cds__resource__manager.cc b/multimedia/mediatomb/patches/patch-src_cds__resource__manager.cc
new file mode 100644
index 00000000000..6a5ec75d4f1
--- /dev/null
+++ b/multimedia/mediatomb/patches/patch-src_cds__resource__manager.cc
@@ -0,0 +1,37 @@
+$NetBSD: patch-src_cds__resource__manager.cc,v 1.1 2012/09/25 11:45:11 ryoon Exp $
+
+Support SONY Bravia
+http://blog-imgs-30.fc2.com/h/o/r/horip/mediatomb-0_12_1_bravia_support_0_1_patch.txt
+
+--- src/cds_resource_manager.cc.orig 2010-03-25 14:58:11.000000000 +0000
++++ src/cds_resource_manager.cc
+@@ -459,6 +459,29 @@ void CdsResourceManager::addResources(Re
+ extend = _(D_PROFILE) + "=" + D_JPEG_LRG+";";
+ }
+ }
++ // Add extended protocol information on filse
++ // need to be transcoded // horipiri
++ else if (strstr(mimeType.c_str(),"video/mpeg"))
++ {
++ extend = _(D_PROFILE) + "=" + D_MPEG_PS_NTSC + ";";
++ }
++ //else if (strstr(mimeType.c_str(),"audio/mp3"))
++ else if (strstr(mimeType.c_str(),"audio/mpeg"))
++ {
++ extend = _(D_PROFILE) + "=" + "MP3" + ";";
++ }
++ else if (strstr(mimeType.c_str(),"audio/L16"))
++ {
++ extend = _(D_PROFILE) + "=" + "LPCM" + ";";
++ }
++ /*
++ else if (strstr(mimeType.c_str(),"video/vnd.dlna.mpeg-tts"))
++ {
++ extend = _(D_PROFILE) + "=" + "MPEG_TS_SD_60_AC3_T" + ";";
++ log_debug("ts HIT!!\n");
++ }
++ log_debug("###mimeType: %s\n", mimeType.c_str());
++ */
+
+ #ifdef EXTERNAL_TRANSCODING
+ // we do not support seeking at all, so 00
diff --git a/multimedia/mediatomb/patches/patch-src_common.h b/multimedia/mediatomb/patches/patch-src_common.h
new file mode 100644
index 00000000000..26d6d39f802
--- /dev/null
+++ b/multimedia/mediatomb/patches/patch-src_common.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_common.h,v 1.1 2012/09/25 11:45:11 ryoon Exp $
+
+Add SONY Bravia support
+http://blog-imgs-30.fc2.com/h/o/r/horip/mediatomb-0_12_1_bravia_support_0_1_patch.txt
+
+--- src/common.h.orig 2010-03-25 14:58:11.000000000 +0000
++++ src/common.h
+@@ -83,6 +83,7 @@
+ #define D_JPEG_TN "JPEG_TN"
+ #define D_JPEG_SM_ICO "JPEG_SM_ICO"
+ #define D_JPEG_LRG_ICO "JPEG_LRG_ICO"
++ #define D_MPEG_PS_NTSC "MPEG_PS_NTSC"
+ #endif
+ // fixed CdsObjectIDs
+ #define CDS_ID_BLACKHOLE -1
diff --git a/multimedia/mediatomb/patches/patch-src_hash_dbo_hash.h b/multimedia/mediatomb/patches/patch-src_hash_dbo_hash.h
index 9036999017b..7de7ad02107 100644
--- a/multimedia/mediatomb/patches/patch-src_hash_dbo_hash.h
+++ b/multimedia/mediatomb/patches/patch-src_hash_dbo_hash.h
@@ -1,8 +1,8 @@
-$NetBSD: patch-src_hash_dbo_hash.h,v 1.1 2011/04/14 07:26:34 adam Exp $
+$NetBSD: patch-src_hash_dbo_hash.h,v 1.2 2012/09/25 11:45:11 ryoon Exp $
Fix building with Clang.
---- src/hash/dbo_hash.h.orig 2011-04-14 07:15:03.000000000 +0000
+--- src/hash/dbo_hash.h.orig 2010-03-25 14:58:07.000000000 +0000
+++ src/hash/dbo_hash.h
@@ -106,7 +106,7 @@ public:
inline bool remove(KT key)
diff --git a/multimedia/mediatomb/patches/patch-src_hash_dbr_hash.h b/multimedia/mediatomb/patches/patch-src_hash_dbr_hash.h
index 6929e6758ef..280ba6e41be 100644
--- a/multimedia/mediatomb/patches/patch-src_hash_dbr_hash.h
+++ b/multimedia/mediatomb/patches/patch-src_hash_dbr_hash.h
@@ -1,8 +1,8 @@
-$NetBSD: patch-src_hash_dbr_hash.h,v 1.1 2011/04/14 07:26:34 adam Exp $
+$NetBSD: patch-src_hash_dbr_hash.h,v 1.2 2012/09/25 11:45:11 ryoon Exp $
Fix building with Clang.
---- src/hash/dbr_hash.h.orig 2011-04-14 07:11:41.000000000 +0000
+--- src/hash/dbr_hash.h.orig 2010-03-25 14:58:07.000000000 +0000
+++ src/hash/dbr_hash.h
@@ -124,7 +124,7 @@ public:
inline bool remove(KT key)
diff --git a/multimedia/mediatomb/patches/patch-src_hash_dso_hash.h b/multimedia/mediatomb/patches/patch-src_hash_dso_hash.h
index 40a013df378..dd7fb7d2126 100644
--- a/multimedia/mediatomb/patches/patch-src_hash_dso_hash.h
+++ b/multimedia/mediatomb/patches/patch-src_hash_dso_hash.h
@@ -1,8 +1,8 @@
-$NetBSD: patch-src_hash_dso_hash.h,v 1.1 2011/04/14 07:26:34 adam Exp $
+$NetBSD: patch-src_hash_dso_hash.h,v 1.2 2012/09/25 11:45:11 ryoon Exp $
Fix building with Clang.
---- src/hash/dso_hash.h.orig 2011-04-14 07:16:11.000000000 +0000
+--- src/hash/dso_hash.h.orig 2010-03-25 14:58:07.000000000 +0000
+++ src/hash/dso_hash.h
@@ -100,7 +100,7 @@ public:
inline bool remove(zmm::String key)
diff --git a/multimedia/mediatomb/patches/patch-src_io__handler__buffer__helper.cc b/multimedia/mediatomb/patches/patch-src_io__handler__buffer__helper.cc
new file mode 100644
index 00000000000..cbed497832c
--- /dev/null
+++ b/multimedia/mediatomb/patches/patch-src_io__handler__buffer__helper.cc
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_io__handler__buffer__helper.cc,v 1.1 2012/09/25 11:45:11 ryoon Exp $
+
+Add SONY Bravia support
+http://blog-imgs-30.fc2.com/h/o/r/horip/mediatomb-0_12_1_bravia_support_0_1_patch.txt
+
+--- src/io_handler_buffer_helper.cc.orig 2010-03-25 14:58:11.000000000 +0000
++++ src/io_handler_buffer_helper.cc
+@@ -222,6 +222,7 @@ void IOHandlerBufferHelper::stopBufferTh
+ void *IOHandlerBufferHelper::staticThreadProc(void *arg)
+ {
+ log_debug("starting buffer thread... thread: %d\n", pthread_self());
++ log_debug("arg for staticThreadProc: %s\n", arg);
+ IOHandlerBufferHelper *inst = (IOHandlerBufferHelper *)arg;
+ inst->threadProc();
+ log_debug("buffer thread shut down. thread: %d\n", pthread_self());
diff --git a/multimedia/mediatomb/patches/patch-src_metadata_ffmpeg__handler.cc b/multimedia/mediatomb/patches/patch-src_metadata_ffmpeg__handler.cc
new file mode 100644
index 00000000000..bfd974d352e
--- /dev/null
+++ b/multimedia/mediatomb/patches/patch-src_metadata_ffmpeg__handler.cc
@@ -0,0 +1,94 @@
+$NetBSD: patch-src_metadata_ffmpeg__handler.cc,v 1.1 2012/09/25 11:45:11 ryoon Exp $
+
+--- src/metadata/ffmpeg_handler.cc.orig 2010-03-25 14:58:10.000000000 +0000
++++ src/metadata/ffmpeg_handler.cc
+@@ -89,47 +89,30 @@ static void addFfmpegMetadataFields(Ref<
+
+ Ref<StringConverter> sc = StringConverter::m2i();
+
+- if (strlen(pFormatCtx->title) > 0)
+- {
+- log_debug("Added metadata title: %s\n", pFormatCtx->title);
+- item->setMetadata(MT_KEYS[M_TITLE].upnp,
+- sc->convert(pFormatCtx->title));
+- }
+- if (strlen(pFormatCtx->author) > 0)
+- {
+- log_debug("Added metadata author: %s\n", pFormatCtx->author);
+- item->setMetadata(MT_KEYS[M_ARTIST].upnp,
+- sc->convert(pFormatCtx->author));
+- }
+- if (strlen(pFormatCtx->album) > 0)
+- {
+- log_debug("Added metadata album: %s\n", pFormatCtx->album);
+- item->setMetadata(MT_KEYS[M_ALBUM].upnp,
+- sc->convert(pFormatCtx->album));
+- }
+- if (pFormatCtx->year > 0)
+- {
+- log_debug("Added metadata year: %d\n", pFormatCtx->year);
+- item->setMetadata(MT_KEYS[M_DATE].upnp,
+- sc->convert(String::from(pFormatCtx->year)));
+- }
+- if (strlen(pFormatCtx->genre) > 0)
+- {
+- log_debug("Added metadata genre: %s\n", pFormatCtx->genre);
+- item->setMetadata(MT_KEYS[M_GENRE].upnp,
+- sc->convert(pFormatCtx->genre));
+- }
+- if (strlen(pFormatCtx->comment) > 0)
+- {
+- log_debug("Added metadata comment: %s\n", pFormatCtx->comment);
+- item->setMetadata(MT_KEYS[M_DESCRIPTION].upnp,
+- sc->convert(pFormatCtx->comment));
+- }
+- if (pFormatCtx->track > 0)
+- {
+- log_debug("Added metadata track: %d\n", pFormatCtx->track);
+- item->setMetadata(MT_KEYS[M_TRACKNUMBER].upnp,
+- sc->convert(String::from(pFormatCtx->track)));
++ typedef struct {const char *avname; metadata_fields_t field;} mapping_t;
++ static const mapping_t mapping[] =
++ {
++ {"title", M_TITLE},
++ {"artist", M_ARTIST},
++ {"album", M_ALBUM},
++ {"date", M_DATE},
++ {"genre", M_GENRE},
++ {"comment", M_DESCRIPTION},
++ {"track", M_TRACKNUMBER},
++ {NULL, M_MAX},
++ };
++
++ if (!pFormatCtx->metadata)
++ return;
++ for (const mapping_t *m = mapping; m->avname != NULL; m++)
++ {
++ AVMetadataTag *tag = NULL;
++ tag = av_metadata_get(pFormatCtx->metadata, m->avname, NULL, 0);
++ if (tag && tag->value && tag->value[0])
++ {
++ log_debug("Added metadata %s: %s\n", m->avname, tag->value);
++ item->setMetadata(MT_KEYS[m->field].upnp, sc->convert(tag->value));
++ }
+ }
+ }
+
+@@ -178,7 +161,7 @@ static void addFfmpegResourceFields(Ref<
+ for(i=0; i<pFormatCtx->nb_streams; i++)
+ {
+ AVStream *st = pFormatCtx->streams[i];
+- if((st != NULL) && (videoset == false) && (st->codec->codec_type == CODEC_TYPE_VIDEO))
++ if((st != NULL) && (videoset == false) && (st->codec->codec_type == AVMEDIA_TYPE_VIDEO))
+ {
+ if (st->codec->codec_tag > 0)
+ {
+@@ -209,7 +192,7 @@ static void addFfmpegResourceFields(Ref<
+ *y = st->codec->height;
+ }
+ }
+- if(st->codec->codec_type == CODEC_TYPE_AUDIO)
++ if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
+ {
+ // Increase number of audiochannels
+ audioch++;
diff --git a/multimedia/mediatomb/patches/patch-src_tools.cc b/multimedia/mediatomb/patches/patch-src_tools.cc
new file mode 100644
index 00000000000..435c125d0bb
--- /dev/null
+++ b/multimedia/mediatomb/patches/patch-src_tools.cc
@@ -0,0 +1,50 @@
+$NetBSD: patch-src_tools.cc,v 1.1 2012/09/25 11:45:11 ryoon Exp $
+
+Add SONY Bravia support
+http://blog-imgs-30.fc2.com/h/o/r/horip/mediatomb-0_12_1_bravia_support_0_1_patch.txt
+
+--- src/tools.cc.orig 2010-03-25 14:58:11.000000000 +0000
++++ src/tools.cc
+@@ -435,7 +435,41 @@ String mime_types_to_CSV(Ref<Array<Strin
+ if (i > 0)
+ *buf << ",";
+ String mimeType = mimeTypes->get(i);
+- *buf << "http-get:*:" << mimeType << ":*";
++// *buf << "http-get:*:" << mimeType << ":*";
++
++ *buf << "http-get:*:" << mimeType;
++
++ log_debug("mimeType: %s..\n", mimeType.c_str() );
++// log_debug("mimeType: %d\n", strcmp(mimeType.c_str(),"video/mpeg"));
++
++ // Add ORG_PN for mimetype that are unnecessary to be trancodeed. // horipiri
++ // Insert video/mpeg if mimeType=video/avi for BRAVIA's server diagnose. // horipiri
++ if (strstr(mimeType.c_str(),"video/mpeg")){
++ *buf << ":DLNA.ORG_PN=MPEG_PS_NTSC";
++ }
++ else if ( (strstr(mimeType.c_str(),"video/avi"))
++ || (strstr(mimeType.c_str(),"video/x-flv"))
++ ) {
++ *buf << ":*,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC";
++ }
++ else if (strstr(mimeType.c_str(),"audio/L16")){
++ *buf << ":DLNA.ORG_PN=LPCM";
++ }
++ else if (strstr(mimeType.c_str(),"audio/mpeg")){
++ *buf << ":DLNA.ORG_PN=MP3";
++ }
++ else if (strstr(mimeType.c_str(),"application/ogg")){
++ *buf << ":*,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3";
++ }
++ else if (strstr(mimeType.c_str(),"image/jpeg")){
++ *buf << ":DLNA.ORG_PN=JPEG_LRG";
++ }
++ else if (strstr(mimeType.c_str(),"video/vnd.dlna.mpeg-tts")){
++ *buf << ":DLNA.ORG_PN=MPEG_TS_SD_60_AC3_T";
++ }
++ else {
++ *buf << ":*";
++ }
+ }
+
+ return buf->toString();
diff --git a/multimedia/mediatomb/patches/patch-src_transcoding_transcode__ext__handler.cc b/multimedia/mediatomb/patches/patch-src_transcoding_transcode__ext__handler.cc
new file mode 100644
index 00000000000..0396623d5fa
--- /dev/null
+++ b/multimedia/mediatomb/patches/patch-src_transcoding_transcode__ext__handler.cc
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_transcoding_transcode__ext__handler.cc,v 1.1 2012/09/25 11:45:11 ryoon Exp $
+
+Add SONY Bravia support
+http://blog-imgs-30.fc2.com/h/o/r/horip/mediatomb-0_12_1_bravia_support_0_1_patch.txt
+
+--- src/transcoding/transcode_ext_handler.cc.orig 2010-03-25 14:58:07.000000000 +0000
++++ src/transcoding/transcode_ext_handler.cc
+@@ -182,7 +182,7 @@ Ref<IOHandler> TranscodeExternalHandler:
+
+ try
+ {
+- chmod(location.c_str(), S_IWUSR | S_IRUSR);
++ chmod(location.c_str(), S_IWUSR | S_IRUSR | S_IROTH);
+
+ Ref<IOHandler> c_ioh(new CurlIOHandler(url, NULL,
+ cfg->getIntOption(CFG_EXTERNAL_TRANSCODING_CURL_BUFFER_SIZE),
diff --git a/multimedia/mediatomb/patches/patch-src_upnp__xml.cc b/multimedia/mediatomb/patches/patch-src_upnp__xml.cc
new file mode 100644
index 00000000000..a34be76e284
--- /dev/null
+++ b/multimedia/mediatomb/patches/patch-src_upnp__xml.cc
@@ -0,0 +1,29 @@
+$NetBSD: patch-src_upnp__xml.cc,v 1.1 2012/09/25 11:45:11 ryoon Exp $
+
+Add SONY Bravia support
+http://blog-imgs-30.fc2.com/h/o/r/horip/mediatomb-0_12_1_bravia_support_0_1_patch.txt
+
+--- src/upnp_xml.cc.orig 2010-03-25 14:58:11.000000000 +0000
++++ src/upnp_xml.cc
+@@ -210,6 +210,21 @@ Ref<Element> UpnpXML_RenderDeviceDescrip
+ root->appendElementChild(specVersion);
+
+ Ref<Element> device(new Element(_("device")));
++
++ Ref<Element> dlnaspec(new Element(_("dlna:X_DLNADOC")));
++ dlnaspec->setAttribute(_("xmlns:dlna"), _("urn:schemas-dlna-org:device-1-0"));
++ dlnaspec->setText(_("DMS-1.50"));
++ device->appendElementChild(dlnaspec);
++
++ Ref<Element> dlnaspec2(new Element(_("dlna:X_DLNADOC")));
++ dlnaspec2->setAttribute(_("xmlns:dlna"), _("urn:schemas-dlna-org:device-1-0"));
++ dlnaspec2->setText(_("M-DMS-1.50"));
++ device->appendElementChild(dlnaspec2);
++
++ Ref<Element> dlnaspec3(new Element(_("dlna:X_DLNACAP")));
++ dlnaspec3->setAttribute(_("xmlns:dlna"), _("urn:schemas-dlna-org:device-1-0"));
++ dlnaspec3->setText(_("av-upload,image-upload,audio-upload"));
++ device->appendElementChild(dlnaspec3);
+
+ #ifdef EXTEND_PROTOCOLINFO
+ if (config->getBoolOption(CFG_SERVER_EXTEND_PROTOCOLINFO))
diff --git a/multimedia/mediatomb/patches/patch-src_youtube__video__url.cc b/multimedia/mediatomb/patches/patch-src_youtube__video__url.cc
new file mode 100644
index 00000000000..7ebcaceba68
--- /dev/null
+++ b/multimedia/mediatomb/patches/patch-src_youtube__video__url.cc
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_youtube__video__url.cc,v 1.1 2012/09/25 11:45:11 ryoon Exp $
+
+--- src/youtube_video_url.cc.orig 2010-04-03 20:23:31.000000000 +0000
++++ src/youtube_video_url.cc
+@@ -47,7 +47,7 @@ using namespace zmm;
+ #define YOUTUBE_URL_PARAMS_REGEXP "var swfHTML.*\\;"
+ #define YOUTUBE_URL_LOCATION_REGEXP "\nLocation: (http://[^\n]+)\n"
+ #define YOUTUBE_URL_WATCH "http://www.youtube.com/watch?v="
+-#define YOUTUBE_URL_GET "http://www.youtube.com/get_video?"
++#define YOUTUBE_URL_GET "http://www.youtube.com/get_video?asv=3&"
+ #define YOUTUBE_URL_PARAM_VIDEO_ID "video_id"
+ #define YOUTUBE_URL_PARAM_T_REGEXP ".*&t=([^&]+)&"
+ #define YOUTUBE_URL_PARAM_T "t"
diff --git a/multimedia/mediatomb/patches/patch-tombupnp_upnp_src_genlib_net_http_webserver.c b/multimedia/mediatomb/patches/patch-tombupnp_upnp_src_genlib_net_http_webserver.c
index 6bd17a9b234..fa31e1299af 100644
--- a/multimedia/mediatomb/patches/patch-tombupnp_upnp_src_genlib_net_http_webserver.c
+++ b/multimedia/mediatomb/patches/patch-tombupnp_upnp_src_genlib_net_http_webserver.c
@@ -1,8 +1,8 @@
-$NetBSD: patch-tombupnp_upnp_src_genlib_net_http_webserver.c,v 1.1 2011/04/14 07:26:34 adam Exp $
+$NetBSD: patch-tombupnp_upnp_src_genlib_net_http_webserver.c,v 1.2 2012/09/25 11:45:11 ryoon Exp $
Fix building with Clang.
---- tombupnp/upnp/src/genlib/net/http/webserver.c.orig 2011-04-14 07:19:15.000000000 +0000
+--- tombupnp/upnp/src/genlib/net/http/webserver.c.orig 2010-03-25 14:58:12.000000000 +0000
+++ tombupnp/upnp/src/genlib/net/http/webserver.c
@@ -310,7 +310,7 @@ search_extension( IN const char *extensi
* 0 - On Sucess