[101437] trunk/dports/net/mediatomb
devans at macports.org
devans at macports.org
Thu Jan 10 17:26:36 PST 2013
Revision: 101437
https://trac.macports.org/changeset/101437
Author: devans at macports.org
Date: 2013-01-10 17:26:36 -0800 (Thu, 10 Jan 2013)
Log Message:
-----------
mediatomb: fix build for automake 1.13 and ffmpeg 1.0 (#37457, #36771)
Modified Paths:
--------------
trunk/dports/net/mediatomb/Portfile
trunk/dports/net/mediatomb/files/patch-configure.ac.diff
Added Paths:
-----------
trunk/dports/net/mediatomb/files/patch-src-metadata-ffmpeg_handler.cc.diff
Modified: trunk/dports/net/mediatomb/Portfile
===================================================================
--- trunk/dports/net/mediatomb/Portfile 2013-01-11 01:22:56 UTC (rev 101436)
+++ trunk/dports/net/mediatomb/Portfile 2013-01-11 01:26:36 UTC (rev 101437)
@@ -38,7 +38,8 @@
use_autoreconf yes
-patchfiles patch-configure.ac.diff
+patchfiles patch-configure.ac.diff \
+ patch-src-metadata-ffmpeg_handler.cc.diff
if {${configure.compiler} == "clang"} {
configure.compiler llvm-gcc-4.2
Modified: trunk/dports/net/mediatomb/files/patch-configure.ac.diff
===================================================================
--- trunk/dports/net/mediatomb/files/patch-configure.ac.diff 2013-01-11 01:22:56 UTC (rev 101436)
+++ trunk/dports/net/mediatomb/files/patch-configure.ac.diff 2013-01-11 01:26:36 UTC (rev 101437)
@@ -1,5 +1,14 @@
---- configure.ac.orig 2010-03-25 10:47:02.000000000 -0500
-+++ configure.ac 2010-03-25 16:11:28.000000000 -0500
+--- configure.ac.orig 2010-04-07 15:38:51.000000000 -0700
++++ configure.ac 2013-01-10 01:42:00.000000000 -0800
+@@ -30,7 +30,7 @@
+
+ AC_PREREQ(2.61)
+ AC_INIT([MediaTomb], [0.12.1], [jin at mediatomb.cc])
+-AM_CONFIG_HEADER([autoconfig.h tombupnp/upnp/inc/upnpconfig.h])
++AC_CONFIG_HEADERS([autoconfig.h tombupnp/upnp/inc/upnpconfig.h])
+ AC_CONFIG_AUX_DIR(configure_aux)
+ AC_CONFIG_SRCDIR([src/common.h])
+ AM_INIT_AUTOMAKE([1.9 -Wall])
@@ -692,8 +692,7 @@
AC_MSG_NOTICE([You are running OSX, assuming threadsafe gethostbyname version])
elif test $CYGWIN_OS -eq 1; then
Added: trunk/dports/net/mediatomb/files/patch-src-metadata-ffmpeg_handler.cc.diff
===================================================================
--- trunk/dports/net/mediatomb/files/patch-src-metadata-ffmpeg_handler.cc.diff (rev 0)
+++ trunk/dports/net/mediatomb/files/patch-src-metadata-ffmpeg_handler.cc.diff 2013-01-11 01:26:36 UTC (rev 101437)
@@ -0,0 +1,90 @@
+--- src/metadata/ffmpeg_handler.cc.orig 2010-03-25 07:58:10.000000000 -0700
++++ src/metadata/ffmpeg_handler.cc 2013-01-10 16:04:04.000000000 -0800
+@@ -89,6 +89,33 @@
+
+ Ref<StringConverter> sc = StringConverter::m2i();
+
++ /* Tabs are 4 characters here */
++ 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++)
++ {
++ AVDictionaryEntry *tag = NULL;
++ tag = av_dict_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));
++ }
++ }
++ /* Old algorithm (doesn't work with libav >= 0.7)
+ if (strlen(pFormatCtx->title) > 0)
+ {
+ log_debug("Added metadata title: %s\n", pFormatCtx->title);
+@@ -131,6 +158,7 @@
+ item->setMetadata(MT_KEYS[M_TRACKNUMBER].upnp,
+ sc->convert(String::from(pFormatCtx->track)));
+ }
++ */
+ }
+
+ // ffmpeg library calls
+@@ -178,7 +206,7 @@
+ 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 +237,7 @@
+ *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++;
+@@ -260,14 +288,14 @@
+ av_register_all();
+
+ // Open video file
+- if (av_open_input_file(&pFormatCtx,
+- item->getLocation().c_str(), NULL, 0, NULL) != 0)
++ if (avformat_open_input(&pFormatCtx,
++ item->getLocation().c_str(), NULL, NULL) != 0)
+ return; // Couldn't open file
+
+ // Retrieve stream information
+- if (av_find_stream_info(pFormatCtx) < 0)
++ if (avformat_find_stream_info(pFormatCtx, NULL) < 0)
+ {
+- av_close_input_file(pFormatCtx);
++ avformat_close_input(&pFormatCtx);
+ return; // Couldn't find stream information
+ }
+ // Add metadata using ffmpeg library calls
+@@ -276,7 +304,7 @@
+ addFfmpegResourceFields(item, pFormatCtx, &x, &y);
+
+ // Close the video file
+- av_close_input_file(pFormatCtx);
++ avformat_close_input(&pFormatCtx);
+ }
+
+ Ref<IOHandler> FfmpegHandler::serveContent(Ref<CdsItem> item, int resNum, off_t *data_size)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130110/fbba5ed8/attachment.html>
More information about the macports-changes
mailing list