Page MenuHomeFreeBSD

D6283.diff
No OneTemporary

D6283.diff

Index: head/multimedia/vdr-plugin-markad/Makefile
===================================================================
--- head/multimedia/vdr-plugin-markad/Makefile
+++ head/multimedia/vdr-plugin-markad/Makefile
@@ -13,7 +13,6 @@
LIB_DEPENDS+= libavcodec.so:multimedia/ffmpeg
USES= execinfo pkgconfig tar:tgz
-PATCH_STRIP= -p1
HAVE_CONFIGURE= yes
PORTDOCS= COPYING README HISTORY
PORTDATA= logos
Index: head/multimedia/vdr-plugin-markad/files/patch-Makefile
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-Makefile
+++ head/multimedia/vdr-plugin-markad/files/patch-Makefile
@@ -1,5 +1,5 @@
---- a/Makefile
-+++ b/Makefile
+--- Makefile.orig 2012-09-11 07:55:41 UTC
++++ Makefile
@@ -13,10 +13,10 @@ ARCHIVE = markad-$(VERSION)
PACKAGE = vdr-$(ARCHIVE)
Index: head/multimedia/vdr-plugin-markad/files/patch-command-Makefile
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-command-Makefile
+++ head/multimedia/vdr-plugin-markad/files/patch-command-Makefile
@@ -1,48 +0,0 @@
---- a/command/Makefile
-+++ b/command/Makefile
-@@ -16,6 +16,10 @@ CXXFLAGS ?= -g -rdynamic -O3 -funroll-lo
- PKG-CONFIG ?= pkg-config
- STRIP ?= strip
-
-+ifdef FREEBSD
-+LIBS+=-lintl -lexecinfo
-+endif
-+
- ### Includes and Defines (add further entries here):
-
- PKG-LIBS += libavcodec libavutil
-@@ -86,17 +90,34 @@ markad: $(OBJS)
- $(CXX) $(CXXFLAGS) $(OBJS) $(LIBS) -o $@
-
-
-+ifdef FREEBSD
-+MANDIR = $(PREFIX)/man
-+else
- MANDIR = $(DESTDIR)/usr/share/man
-+endif
- install-doc:
-+ifdef FREEBSD
-+ @mkdir -p ${DESTDIR}$(MANDIR)/man1
-+ @gzip -c markad.1 > ${DESTDIR}$(MANDIR)/man1/markad.1.gz
-+else
- @mkdir -p $(MANDIR)/man1
- @gzip -c markad.1 > $(MANDIR)/man1/markad.1.gz
-+endif
-
- install: install-doc markad $(I18Nmsgs)
-+ifdef FREEBSD
-+ @mkdir -p ${DESTDIR}$(PREFIX)/bin
-+ @cp -f markad ${DESTDIR}$(PREFIX)/bin/markad
-+ @$(STRIP) ${DESTDIR}$(PREFIX)/bin/markad
-+ @mkdir -p ${DESTDIR}$(DATADIR)/logos
-+ @cp logos/* ${DESTDIR}$(DATADIR)/logos
-+else
- @mkdir -p $(DESTDIR)/usr/bin
- @cp --remove-destination markad $(DESTDIR)/usr/bin/markad
- @$(STRIP) $(DESTDIR)/usr/bin/markad
- @mkdir -p $(DESTDIR)/var/lib/markad
- @cp -a logos/* $(DESTDIR)/var/lib/markad
-+endif
- @echo markad installed
-
- clean:
Index: head/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp
+++ head/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp
@@ -1,36 +0,0 @@
---- a/command/decoder.cpp
-+++ b/command/decoder.cpp
-@@ -6,7 +6,12 @@
- */
-
- #include <stdint.h>
-+#ifndef __FreeBSD__
- #include <sched.h>
-+#else
-+#include <sys/types.h>
-+#include <sys/sysctl.h>
-+#endif
- #include <errno.h>
- #include <sys/types.h>
- #include <string.h>
-@@ -107,6 +112,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
- noticeERRMP2=false;
- noticeERRAC3=false;
-
-+#ifndef __FreeBSD__
- cpu_set_t cpumask;
- uint len = sizeof(cpumask);
- int cpucount;
-@@ -118,6 +124,12 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
- {
- cpucount=CPU_COUNT(&cpumask);
- }
-+#else
-+ int cpucount;
-+ size_t cpus_size = sizeof(cpucount);
-+ if (sysctlbyname("hw.ncpu", &cpucount, &cpus_size, NULL, 0) == -1)
-+ cpucount = 1;
-+#endif
-
- if (Threads==-1)
- {
Index: head/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp-ffmpeg1
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp-ffmpeg1
+++ head/multimedia/vdr-plugin-markad/files/patch-command-decoder.cpp-ffmpeg1
@@ -1,11 +0,0 @@
---- a/command/decoder.cpp
-+++ b/command/decoder.cpp
-@@ -164,7 +164,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
- }
-
- video_codec=NULL;
-- CodecID video_codecid;
-+ AVCodecID video_codecid;
-
- if (useH264)
- {
Index: head/multimedia/vdr-plugin-markad/files/patch-command-markad-standalone.cpp
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-command-markad-standalone.cpp
+++ head/multimedia/vdr-plugin-markad/files/patch-command-markad-standalone.cpp
@@ -1,138 +0,0 @@
---- a/command/markad-standalone.cpp
-+++ b/command/markad-standalone.cpp
-@@ -24,7 +24,13 @@
- #include <locale.h>
- #include <libintl.h>
- #include <execinfo.h>
-+#ifndef __FreeBSD__
- #include <mntent.h>
-+#else
-+#include <netinet/in.h>
-+#include <sys/socket.h>
-+#include <sys/mount.h>
-+#endif
- #include <utime.h>
- #include <math.h>
- #include <limits.h>
-@@ -1428,6 +1434,7 @@ bool cMarkAdStandalone::SaveInfo()
- time_t cMarkAdStandalone::GetBroadcastStart(time_t start, int fd)
- {
- // get broadcast start from atime of directory (if the volume is mounted with noatime)
-+#ifndef __FreeBSD__
- struct mntent *ent;
- struct stat statbuf;
- FILE *mounts=setmntent(_PATH_MOUNTED,"r");
-@@ -1454,6 +1461,14 @@ time_t cMarkAdStandalone::GetBroadcastSt
- }
- }
- endmntent(mounts);
-+#else
-+ struct stat statbuf;
-+ struct statfs statfsbuf;
-+ bool useatime=false;
-+ if ((statfs(directory, &statfsbuf) == 0) &&
-+ !(statfsbuf.f_flags & MNT_NOATIME))
-+ useatime=true;
-+#endif
-
- if ((useatime) && (stat(directory,&statbuf)!=-1))
- {
-@@ -1554,6 +1569,16 @@ bool cMarkAdStandalone::LoadInfo()
- if (lf) *lf=0;
- char *cr=strchr(macontext.Info.ChannelName,13);
- if (cr) *cr=0;
-+#if 1
-+ int len = strlen(macontext.Info.ChannelName);
-+ if (len > 5 &&
-+ (!strcmp(macontext.Info.ChannelName + len - 4, " (A)") ||
-+ !strcmp(macontext.Info.ChannelName + len - 4, " (C)") ||
-+ !strcmp(macontext.Info.ChannelName + len - 4, " (S)") ||
-+ !strcmp(macontext.Info.ChannelName + len - 4, " (T)") ||
-+ !strcmp(macontext.Info.ChannelName + len - 4, " (I)")))
-+ macontext.Info.ChannelName[len - 4] = '\0';
-+#endif
- for (int i=0; i<(int) strlen(macontext.Info.ChannelName); i++)
- {
- if (macontext.Info.ChannelName[i]==' ') macontext.Info.ChannelName[i]='_';
-@@ -1961,10 +1986,14 @@ bool cMarkAdStandalone::CreatePidfile()
- int pid;
- if (fscanf(oldpid,"%10i\n",&pid)==1)
- {
-+#ifndef __FreeBSD__
- char procname[256]="";
- snprintf(procname,sizeof(procname),"/proc/%i",pid);
- struct stat statbuf;
- if (stat(procname,&statbuf)!=-1)
-+#else
-+ if (kill(pid, 0) == 0)
-+#endif
- {
- // found another, running markad
- fprintf(stderr,"another instance is running on %s",directory);
-@@ -2081,6 +2110,7 @@ cMarkAdStandalone::cMarkAdStandalone(con
- }
- }
-
-+#ifndef __FreeBSD__
- long lb;
- errno=0;
- lb=sysconf(_SC_LONG_BIT);
-@@ -2089,6 +2119,7 @@ cMarkAdStandalone::cMarkAdStandalone(con
- isyslog("starting v%s (%libit)",VERSION,lb);
- }
- else
-+#endif
- {
- isyslog("starting v%s",VERSION);
- }
-@@ -2319,7 +2350,7 @@ cMarkAdStandalone::~cMarkAdStandalone()
- RemovePidfile();
- }
-
--bool isnumber(const char *s)
-+bool str_isnumber(const char *s)
- {
- while (*s)
- {
-@@ -2345,7 +2376,11 @@ int usage(int svdrpport)
- " ignores hints from info(.vdr) file\n"
- " <info> 4 = ignore timer info\n"
- "-l --logocachedir\n"
-+#ifdef DATADIR
-+ " directory where logos stored, default " DATADIR "/logos\n"
-+#else
- " directory where logos stored, default /var/lib/markad\n"
-+#endif
- "-p --priority=<priority>\n"
- " software priority of markad when running in background\n"
- " <priority> from -20...19, default 19\n"
-@@ -2489,7 +2524,11 @@ int main(int argc, char *argv[])
- config.logoHeight=-1;
- config.threads=-1;
- strcpy(config.svdrphost,"127.0.0.1");
-+#ifdef DATADIR
-+ strcpy(config.logoDirectory,DATADIR "/logos");
-+#else
- strcpy(config.logoDirectory,"/var/lib/markad");
-+#endif
-
- struct servent *serv=getservbyname("svdrp","tcp");
- if (serv)
-@@ -2620,7 +2659,7 @@ int main(int argc, char *argv[])
-
- case 'p':
- // --priority
-- if (isnumber(optarg) || *optarg=='-')
-+ if (str_isnumber(optarg) || *optarg=='-')
- niceLevel = atoi(optarg);
- else
- {
-@@ -2806,7 +2845,7 @@ int main(int argc, char *argv[])
- break;
-
- case 9: // --svdrpport
-- if (isnumber(optarg) && atoi(optarg) > 0 && atoi(optarg) < 65536)
-+ if (str_isnumber(optarg) && atoi(optarg) > 0 && atoi(optarg) < 65536)
- {
- config.svdrpport=atoi(optarg);
- }
Index: head/multimedia/vdr-plugin-markad/files/patch-command_Makefile
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-command_Makefile
+++ head/multimedia/vdr-plugin-markad/files/patch-command_Makefile
@@ -0,0 +1,48 @@
+--- command/Makefile.orig 2012-09-11 07:54:03 UTC
++++ command/Makefile
+@@ -16,6 +16,10 @@ CXXFLAGS ?= -g -rdynamic -O3 -funroll-lo
+ PKG-CONFIG ?= pkg-config
+ STRIP ?= strip
+
++ifdef FREEBSD
++LIBS+=-lintl -lexecinfo
++endif
++
+ ### Includes and Defines (add further entries here):
+
+ PKG-LIBS += libavcodec libavutil
+@@ -86,17 +90,34 @@ markad: $(OBJS)
+ $(CXX) $(CXXFLAGS) $(OBJS) $(LIBS) -o $@
+
+
++ifdef FREEBSD
++MANDIR = $(PREFIX)/man
++else
+ MANDIR = $(DESTDIR)/usr/share/man
++endif
+ install-doc:
++ifdef FREEBSD
++ @mkdir -p ${DESTDIR}$(MANDIR)/man1
++ @gzip -c markad.1 > ${DESTDIR}$(MANDIR)/man1/markad.1.gz
++else
+ @mkdir -p $(MANDIR)/man1
+ @gzip -c markad.1 > $(MANDIR)/man1/markad.1.gz
++endif
+
+ install: install-doc markad $(I18Nmsgs)
++ifdef FREEBSD
++ @mkdir -p ${DESTDIR}$(PREFIX)/bin
++ @cp -f markad ${DESTDIR}$(PREFIX)/bin/markad
++ @$(STRIP) ${DESTDIR}$(PREFIX)/bin/markad
++ @mkdir -p ${DESTDIR}$(DATADIR)/logos
++ @cp logos/* ${DESTDIR}$(DATADIR)/logos
++else
+ @mkdir -p $(DESTDIR)/usr/bin
+ @cp --remove-destination markad $(DESTDIR)/usr/bin/markad
+ @$(STRIP) $(DESTDIR)/usr/bin/markad
+ @mkdir -p $(DESTDIR)/var/lib/markad
+ @cp -a logos/* $(DESTDIR)/var/lib/markad
++endif
+ @echo markad installed
+
+ clean:
Index: head/multimedia/vdr-plugin-markad/files/patch-command_decoder.h
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-command_decoder.h
+++ head/multimedia/vdr-plugin-markad/files/patch-command_decoder.h
@@ -0,0 +1,10 @@
+--- command/decoder.h.orig 2012-02-24 20:08:34 UTC
++++ command/decoder.h
+@@ -18,6 +18,7 @@ extern "C"
+ #include <avcodec.h>
+ #else
+ #include <libavcodec/avcodec.h>
++#include <libavutil/mem.h>
+ #endif
+
+ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
Index: head/multimedia/vdr-plugin-markad/files/patch-command_decoder.cpp
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-command_decoder.cpp
+++ head/multimedia/vdr-plugin-markad/files/patch-command_decoder.cpp
@@ -0,0 +1,165 @@
+--- command/decoder.cpp.orig 2012-04-02 19:41:15 UTC
++++ command/decoder.cpp
+@@ -6,11 +6,17 @@
+ */
+
+ #include <stdint.h>
++#ifndef __FreeBSD__
+ #include <sched.h>
++#else
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#endif
+ #include <errno.h>
+ #include <sys/types.h>
+ #include <string.h>
+ #include <cstdlib>
++#include <stdio.h>
+
+ #include "decoder.h"
+
+@@ -113,6 +119,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+
+ noticeERRVID=false;
+
++#ifndef __FreeBSD__
+ cpu_set_t cpumask;
+ uint len = sizeof(cpumask);
+ int cpucount=1;
+@@ -120,6 +127,12 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+ {
+ cpucount=CPU_COUNT(&cpumask);
+ }
++#else
++ int cpucount;
++ size_t cpus_size = sizeof(cpucount);
++ if (sysctlbyname("hw.ncpu", &cpucount, &cpus_size, NULL, 0) == -1)
++ cpucount = 1;
++#endif
+
+ if (Threads==-1)
+ {
+@@ -151,28 +164,28 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+ }
+
+ video_codec=NULL;
+- CodecID video_codecid;
++ AVCodecID video_codecid;
+
+ if (useH264)
+ {
+- video_codecid=CODEC_ID_H264;
++ video_codecid=AV_CODEC_ID_H264;
+ }
+ else
+ {
+- video_codecid=CODEC_ID_MPEG2VIDEO_XVMC;
++ video_codecid=AV_CODEC_ID_MPEG2VIDEO_XVMC;
+ }
+
+ video_codec = avcodec_find_decoder(video_codecid);
+- if ((!video_codec) && (video_codecid==CODEC_ID_MPEG2VIDEO_XVMC))
++ if ((!video_codec) && (video_codecid==AV_CODEC_ID_MPEG2VIDEO_XVMC))
+ {
+ // fallback to MPEG2VIDEO
+- video_codecid=CODEC_ID_MPEG2VIDEO;
++ video_codecid=AV_CODEC_ID_MPEG2VIDEO;
+ video_codec=avcodec_find_decoder(video_codecid);
+ }
+
+ if (video_codec)
+ {
+- video_context = avcodec_alloc_context();
++ video_context = avcodec_alloc_context3(NULL);
+ if (video_context)
+ {
+ if (video_codec->capabilities & CODEC_CAP_TRUNCATED)
+@@ -183,7 +196,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+
+ av_log_set_level(AV_LOG_FATAL); // silence decoder output
+
+- if (video_codecid==CODEC_ID_H264)
++ if (video_codecid==AV_CODEC_ID_H264)
+ {
+ video_context->flags2|=CODEC_FLAG2_CHUNKS; // needed for H264!
+ }
+@@ -198,15 +211,15 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+ #else
+ int ret=avcodec_open(video_context, video_codec);
+ #endif
+- if ((ret < 0) && (video_codecid==CODEC_ID_MPEG2VIDEO_XVMC))
++ if ((ret < 0) && (video_codecid==AV_CODEC_ID_MPEG2VIDEO_XVMC))
+ {
+ // fallback to MPEG2VIDEO
+- video_codecid=CODEC_ID_MPEG2VIDEO;
++ video_codecid=AV_CODEC_ID_MPEG2VIDEO;
+ video_codec=avcodec_find_decoder(video_codecid);
+ if (video_codec)
+ {
+ video_context->codec_type=AVMEDIA_TYPE_UNKNOWN;
+- video_context->codec_id=CODEC_ID_NONE;
++ video_context->codec_id=AV_CODEC_ID_NONE;
+ video_context->codec_tag=0;
+ memset(video_context->codec_name,0,sizeof(video_context->codec_name));
+ #if LIBAVCODEC_VERSION_INT >= ((53<<16)+(5<<8)+0)
+@@ -225,13 +238,13 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+ {
+ switch (video_codecid)
+ {
+- case CODEC_ID_H264:
++ case AV_CODEC_ID_H264:
+ esyslog("could not open codec for H264");
+ break;
+- case CODEC_ID_MPEG2VIDEO_XVMC:
++ case AV_CODEC_ID_MPEG2VIDEO_XVMC:
+ esyslog("could not open codec MPEG2 (XVMC)");
+ break;
+- case CODEC_ID_MPEG2VIDEO:
++ case AV_CODEC_ID_MPEG2VIDEO:
+ esyslog("could not open codec MPEG2");
+ break;
+ default:
+@@ -256,7 +269,7 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+ }
+ #endif
+
+- video_frame = avcodec_alloc_frame();
++ video_frame = av_frame_alloc();
+ if (!video_frame)
+ {
+ esyslog("could not allocate frame");
+@@ -286,13 +299,13 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH
+ {
+ switch (video_codecid)
+ {
+- case CODEC_ID_H264:
++ case AV_CODEC_ID_H264:
+ esyslog("codec for H264 not found");
+ break;
+- case CODEC_ID_MPEG2VIDEO_XVMC:
++ case AV_CODEC_ID_MPEG2VIDEO_XVMC:
+ esyslog("codec for MPEG2 (XVMC) not found");
+ break;
+- case CODEC_ID_MPEG2VIDEO:
++ case AV_CODEC_ID_MPEG2VIDEO:
+ esyslog("codec for MPEG2 not found");
+ break;
+ default:
+@@ -321,7 +334,7 @@ bool cMarkAdDecoder::Clear()
+ {
+ avcodec_flush_buffers(video_context);
+ AVCodecContext *dest;
+- dest=avcodec_alloc_context();
++ dest=avcodec_alloc_context3(NULL);
+ if (dest)
+ {
+ if (avcodec_copy_context(dest,video_context)!=0) ret=false;
+@@ -384,7 +397,7 @@ bool cMarkAdDecoder::DecodeVideo(MarkAdC
+ if (!video_frame) return false;
+ maContext->Video.Data.Valid=false;
+
+- if ((video_context->codec_id==CODEC_ID_H264) && (!video_context->skip_frame))
++ if ((video_context->codec_id==AV_CODEC_ID_H264) && (!video_context->skip_frame))
+ {
+ // with H264 we cannot set skip_frame just to NONKEY, is depends on Interlaced...
+ if (maContext->Video.Info.Height)
Index: head/multimedia/vdr-plugin-markad/files/patch-command_markad-standalone.cpp
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-command_markad-standalone.cpp
+++ head/multimedia/vdr-plugin-markad/files/patch-command_markad-standalone.cpp
@@ -0,0 +1,138 @@
+--- command/markad-standalone.cpp.orig 2012-09-11 11:06:28 UTC
++++ command/markad-standalone.cpp
+@@ -24,7 +24,13 @@
+ #include <locale.h>
+ #include <libintl.h>
+ #include <execinfo.h>
++#ifndef __FreeBSD__
+ #include <mntent.h>
++#else
++#include <netinet/in.h>
++#include <sys/socket.h>
++#include <sys/mount.h>
++#endif
+ #include <utime.h>
+ #include <math.h>
+ #include <limits.h>
+@@ -1428,6 +1434,7 @@ bool cMarkAdStandalone::SaveInfo()
+ time_t cMarkAdStandalone::GetBroadcastStart(time_t start, int fd)
+ {
+ // get broadcast start from atime of directory (if the volume is mounted with noatime)
++#ifndef __FreeBSD__
+ struct mntent *ent;
+ struct stat statbuf;
+ FILE *mounts=setmntent(_PATH_MOUNTED,"r");
+@@ -1454,6 +1461,14 @@ time_t cMarkAdStandalone::GetBroadcastSt
+ }
+ }
+ endmntent(mounts);
++#else
++ struct stat statbuf;
++ struct statfs statfsbuf;
++ bool useatime=false;
++ if ((statfs(directory, &statfsbuf) == 0) &&
++ !(statfsbuf.f_flags & MNT_NOATIME))
++ useatime=true;
++#endif
+
+ if ((useatime) && (stat(directory,&statbuf)!=-1))
+ {
+@@ -1554,6 +1569,16 @@ bool cMarkAdStandalone::LoadInfo()
+ if (lf) *lf=0;
+ char *cr=strchr(macontext.Info.ChannelName,13);
+ if (cr) *cr=0;
++#if 1
++ int len = strlen(macontext.Info.ChannelName);
++ if (len > 5 &&
++ (!strcmp(macontext.Info.ChannelName + len - 4, " (A)") ||
++ !strcmp(macontext.Info.ChannelName + len - 4, " (C)") ||
++ !strcmp(macontext.Info.ChannelName + len - 4, " (S)") ||
++ !strcmp(macontext.Info.ChannelName + len - 4, " (T)") ||
++ !strcmp(macontext.Info.ChannelName + len - 4, " (I)")))
++ macontext.Info.ChannelName[len - 4] = '\0';
++#endif
+ for (int i=0; i<(int) strlen(macontext.Info.ChannelName); i++)
+ {
+ if (macontext.Info.ChannelName[i]==' ') macontext.Info.ChannelName[i]='_';
+@@ -1961,10 +1986,14 @@ bool cMarkAdStandalone::CreatePidfile()
+ int pid;
+ if (fscanf(oldpid,"%10i\n",&pid)==1)
+ {
++#ifndef __FreeBSD__
+ char procname[256]="";
+ snprintf(procname,sizeof(procname),"/proc/%i",pid);
+ struct stat statbuf;
+ if (stat(procname,&statbuf)!=-1)
++#else
++ if (kill(pid, 0) == 0)
++#endif
+ {
+ // found another, running markad
+ fprintf(stderr,"another instance is running on %s",directory);
+@@ -2081,6 +2110,7 @@ cMarkAdStandalone::cMarkAdStandalone(con
+ }
+ }
+
++#ifndef __FreeBSD__
+ long lb;
+ errno=0;
+ lb=sysconf(_SC_LONG_BIT);
+@@ -2089,6 +2119,7 @@ cMarkAdStandalone::cMarkAdStandalone(con
+ isyslog("starting v%s (%libit)",VERSION,lb);
+ }
+ else
++#endif
+ {
+ isyslog("starting v%s",VERSION);
+ }
+@@ -2319,7 +2350,7 @@ cMarkAdStandalone::~cMarkAdStandalone()
+ RemovePidfile();
+ }
+
+-bool isnumber(const char *s)
++bool str_isnumber(const char *s)
+ {
+ while (*s)
+ {
+@@ -2345,7 +2376,11 @@ int usage(int svdrpport)
+ " ignores hints from info(.vdr) file\n"
+ " <info> 4 = ignore timer info\n"
+ "-l --logocachedir\n"
++#ifdef DATADIR
++ " directory where logos stored, default " DATADIR "/logos\n"
++#else
+ " directory where logos stored, default /var/lib/markad\n"
++#endif
+ "-p --priority=<priority>\n"
+ " software priority of markad when running in background\n"
+ " <priority> from -20...19, default 19\n"
+@@ -2489,7 +2524,11 @@ int main(int argc, char *argv[])
+ config.logoHeight=-1;
+ config.threads=-1;
+ strcpy(config.svdrphost,"127.0.0.1");
++#ifdef DATADIR
++ strcpy(config.logoDirectory,DATADIR "/logos");
++#else
+ strcpy(config.logoDirectory,"/var/lib/markad");
++#endif
+
+ struct servent *serv=getservbyname("svdrp","tcp");
+ if (serv)
+@@ -2620,7 +2659,7 @@ int main(int argc, char *argv[])
+
+ case 'p':
+ // --priority
+- if (isnumber(optarg) || *optarg=='-')
++ if (str_isnumber(optarg) || *optarg=='-')
+ niceLevel = atoi(optarg);
+ else
+ {
+@@ -2806,7 +2845,7 @@ int main(int argc, char *argv[])
+ break;
+
+ case 9: // --svdrpport
+- if (isnumber(optarg) && atoi(optarg) > 0 && atoi(optarg) < 65536)
++ if (str_isnumber(optarg) && atoi(optarg) > 0 && atoi(optarg) < 65536)
+ {
+ config.svdrpport=atoi(optarg);
+ }
Index: head/multimedia/vdr-plugin-markad/files/patch-plugin-Makefile
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-plugin-Makefile
+++ head/multimedia/vdr-plugin-markad/files/patch-plugin-Makefile
@@ -1,22 +0,0 @@
---- a/plugin/Makefile
-+++ b/plugin/Makefile
-@@ -99,11 +99,19 @@ i18n: $(I18Nmsgs) $(I18Npot)
- ### Targets:
-
- install: all
-+ifdef FREEBSD
-+ ${INSTALL_PROGRAM} $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION) ${DESTDIR}$(PREFIX)/lib/vdr/libvdr-$(PLUGIN).so.$(APIVERSION)
-+else
- cp --remove-destination libvdr-$(PLUGIN).so $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION)
-+endif
-
- libvdr-$(PLUGIN).so: $(OBJS)
- $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@
-+ifdef FREEBSD
-+ cp -f libvdr-$(PLUGIN).so $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION)
-+else
- cp --remove-destination libvdr-$(PLUGIN).so $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION)
-+endif
-
- clean:
- @-rm -f $(OBJS) $(DEPFILE) *.so *.so.* *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
Index: head/multimedia/vdr-plugin-markad/files/patch-plugin-markad.cpp
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-plugin-markad.cpp
+++ head/multimedia/vdr-plugin-markad/files/patch-plugin-markad.cpp
@@ -1,19 +0,0 @@
---- a/plugin/markad.cpp
-+++ b/plugin/markad.cpp
-@@ -15,8 +15,16 @@
-
- #include "markad.h"
-
-+#ifdef PREFIX
-+#define DEF_BINDIR PREFIX "/bin"
-+#else
- #define DEF_BINDIR "/usr/bin"
-+#endif
-+#ifdef DATADIR
-+#define DEF_LOGODIR DATADIR "/logos"
-+#else
- #define DEF_LOGODIR "/var/lib/markad"
-+#endif
-
- cPluginMarkAd::cPluginMarkAd(void)
- {
Index: head/multimedia/vdr-plugin-markad/files/patch-plugin-status.cpp
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-plugin-status.cpp
+++ head/multimedia/vdr-plugin-markad/files/patch-plugin-status.cpp
@@ -1,113 +0,0 @@
---- a/plugin/status.cpp
-+++ b/plugin/status.cpp
-@@ -6,6 +6,12 @@
- */
-
- #include <signal.h>
-+#ifdef __FreeBSD__
-+#include <sys/types.h>
-+#include <sys/sysctl.h>
-+#include <sys/user.h>
-+#include <sys/vmmeter.h>
-+#endif
-
- #include "status.h"
-
-@@ -135,7 +141,12 @@ bool cStatusMarkAd::LogoExists(const cha
- cTimer *timer=NULL;
- for (cTimer *Timer = Timers.First(); Timer; Timer=Timers.Next(Timer))
- {
-+#if 1
-+ if (Timer->Recording() &&
-+ (!strcmp(Timer->ToDescr(),Name) || !strcmp(Timer->File(),Name)))
-+#else
- if (Timer->Recording() && (!strcmp(Timer->ToDescr(),Name)))
-+#endif
- {
- timer=Timer;
- break;
-@@ -150,6 +161,16 @@ bool cStatusMarkAd::LogoExists(const cha
- if (!chan) return false;
- char *cname=strdup(chan->Name());
- if (!cname) return false;
-+#if 1
-+ int len = strlen(cname);
-+ if (len > 5 &&
-+ (!strcmp(cname + len - 4, " (A)") ||
-+ !strcmp(cname + len - 4, " (C)") ||
-+ !strcmp(cname + len - 4, " (S)") ||
-+ !strcmp(cname + len - 4, " (T)") ||
-+ !strcmp(cname + len - 4, " (I)")))
-+ cname[len - 4] = '\0';
-+#endif
- for (int i=0; i<(int) strlen(cname); i++)
- {
- if (cname[i]==' ') cname[i]='_';
-@@ -233,6 +254,7 @@ bool cStatusMarkAd::getStatus(int Positi
- if (Position<0) return false;
- if (!recs[Position].Pid) return false;
- int ret=0;
-+#ifndef __FreeBSD__
- char procname[256]="";
- snprintf(procname,sizeof(procname),"/proc/%i/stat",recs[Position].Pid);
- FILE *fstat=fopen(procname,"r");
-@@ -252,6 +274,59 @@ bool cStatusMarkAd::getStatus(int Positi
- }
- }
- return (ret==1);
-+#else
-+ int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, recs[Position].Pid};
-+ size_t len = 0;
-+ struct kinfo_proc *kipp = NULL;
-+ if (sysctl(mib, sizeof(mib)/sizeof(*mib), NULL, &len, NULL, 0) >= 0 &&
-+ (kipp = (kinfo_proc *)malloc(len)) != NULL &&
-+ sysctl(mib, sizeof(mib)/sizeof(*mib), kipp, &len, NULL, 0) >= 0 &&
-+ len == sizeof(*kipp) && kipp->ki_structsize == sizeof(*kipp) &&
-+ kipp->ki_pid == recs[Position].Pid) {
-+
-+ int tdflags = kipp->ki_tdflags; /* XXXKSE */
-+
-+ ret = 1;
-+
-+ switch (kipp->ki_stat) {
-+
-+ case SSTOP:
-+ recs[Position].Status = 'T';
-+ break;
-+
-+ case SSLEEP:
-+ if (tdflags & TDF_SINTR) /* interruptable (long) */
-+ recs[Position].Status = /* kipp->ki_slptime >= MAXSLP ? 'I' : */ 'S';
-+ else
-+ recs[Position].Status = 'D';
-+ break;
-+
-+ case SRUN:
-+ case SIDL:
-+ recs[Position].Status = 'R';
-+ break;
-+
-+ case SWAIT:
-+ recs[Position].Status = 'W';
-+ break;
-+
-+ case SLOCK:
-+ recs[Position].Status = 'L';
-+ break;
-+
-+ case SZOMB:
-+ recs[Position].Status = 'Z';
-+ break;
-+
-+ default:
-+ recs[Position].Status = '?';
-+ }
-+ } else {
-+ Remove(Position);
-+ }
-+ free(kipp);
-+ return ret;
-+#endif
- }
-
- bool cStatusMarkAd::getPid(int Position)
Index: head/multimedia/vdr-plugin-markad/files/patch-plugin_Makefile
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-plugin_Makefile
+++ head/multimedia/vdr-plugin-markad/files/patch-plugin_Makefile
@@ -0,0 +1,22 @@
+--- plugin/Makefile.orig 2012-02-13 19:32:27 UTC
++++ plugin/Makefile
+@@ -99,11 +99,19 @@ i18n: $(I18Nmsgs) $(I18Npot)
+ ### Targets:
+
+ install: all
++ifdef FREEBSD
++ ${INSTALL_PROGRAM} $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION) ${DESTDIR}$(PREFIX)/lib/vdr/libvdr-$(PLUGIN).so.$(APIVERSION)
++else
+ cp --remove-destination libvdr-$(PLUGIN).so $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION)
++endif
+
+ libvdr-$(PLUGIN).so: $(OBJS)
+ $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@
++ifdef FREEBSD
++ cp -f libvdr-$(PLUGIN).so $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION)
++else
+ cp --remove-destination libvdr-$(PLUGIN).so $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION)
++endif
+
+ clean:
+ @-rm -f $(OBJS) $(DEPFILE) *.so *.so.* *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
Index: head/multimedia/vdr-plugin-markad/files/patch-plugin_markad.cpp
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-plugin_markad.cpp
+++ head/multimedia/vdr-plugin-markad/files/patch-plugin_markad.cpp
@@ -0,0 +1,19 @@
+--- plugin/markad.cpp.orig 2012-09-10 12:45:12 UTC
++++ plugin/markad.cpp
+@@ -15,8 +15,16 @@
+
+ #include "markad.h"
+
++#ifdef PREFIX
++#define DEF_BINDIR PREFIX "/bin"
++#else
+ #define DEF_BINDIR "/usr/bin"
++#endif
++#ifdef DATADIR
++#define DEF_LOGODIR DATADIR "/logos"
++#else
+ #define DEF_LOGODIR "/var/lib/markad"
++#endif
+
+ cPluginMarkAd::cPluginMarkAd(void)
+ {
Index: head/multimedia/vdr-plugin-markad/files/patch-plugin_status.cpp
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-plugin_status.cpp
+++ head/multimedia/vdr-plugin-markad/files/patch-plugin_status.cpp
@@ -0,0 +1,113 @@
+--- plugin/status.cpp.orig 2012-09-09 23:00:32 UTC
++++ plugin/status.cpp
+@@ -6,6 +6,12 @@
+ */
+
+ #include <signal.h>
++#ifdef __FreeBSD__
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#include <sys/user.h>
++#include <sys/vmmeter.h>
++#endif
+
+ #include "status.h"
+
+@@ -135,7 +141,12 @@ bool cStatusMarkAd::LogoExists(const cha
+ cTimer *timer=NULL;
+ for (cTimer *Timer = Timers.First(); Timer; Timer=Timers.Next(Timer))
+ {
++#if 1
++ if (Timer->Recording() &&
++ (!strcmp(Timer->ToDescr(),Name) || !strcmp(Timer->File(),Name)))
++#else
+ if (Timer->Recording() && (!strcmp(Timer->ToDescr(),Name)))
++#endif
+ {
+ timer=Timer;
+ break;
+@@ -150,6 +161,16 @@ bool cStatusMarkAd::LogoExists(const cha
+ if (!chan) return false;
+ char *cname=strdup(chan->Name());
+ if (!cname) return false;
++#if 1
++ int len = strlen(cname);
++ if (len > 5 &&
++ (!strcmp(cname + len - 4, " (A)") ||
++ !strcmp(cname + len - 4, " (C)") ||
++ !strcmp(cname + len - 4, " (S)") ||
++ !strcmp(cname + len - 4, " (T)") ||
++ !strcmp(cname + len - 4, " (I)")))
++ cname[len - 4] = '\0';
++#endif
+ for (int i=0; i<(int) strlen(cname); i++)
+ {
+ if (cname[i]==' ') cname[i]='_';
+@@ -233,6 +254,7 @@ bool cStatusMarkAd::getStatus(int Positi
+ if (Position<0) return false;
+ if (!recs[Position].Pid) return false;
+ int ret=0;
++#ifndef __FreeBSD__
+ char procname[256]="";
+ snprintf(procname,sizeof(procname),"/proc/%i/stat",recs[Position].Pid);
+ FILE *fstat=fopen(procname,"r");
+@@ -252,6 +274,59 @@ bool cStatusMarkAd::getStatus(int Positi
+ }
+ }
+ return (ret==1);
++#else
++ int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, recs[Position].Pid};
++ size_t len = 0;
++ struct kinfo_proc *kipp = NULL;
++ if (sysctl(mib, sizeof(mib)/sizeof(*mib), NULL, &len, NULL, 0) >= 0 &&
++ (kipp = (kinfo_proc *)malloc(len)) != NULL &&
++ sysctl(mib, sizeof(mib)/sizeof(*mib), kipp, &len, NULL, 0) >= 0 &&
++ len == sizeof(*kipp) && kipp->ki_structsize == sizeof(*kipp) &&
++ kipp->ki_pid == recs[Position].Pid) {
++
++ int tdflags = kipp->ki_tdflags; /* XXXKSE */
++
++ ret = 1;
++
++ switch (kipp->ki_stat) {
++
++ case SSTOP:
++ recs[Position].Status = 'T';
++ break;
++
++ case SSLEEP:
++ if (tdflags & TDF_SINTR) /* interruptable (long) */
++ recs[Position].Status = /* kipp->ki_slptime >= MAXSLP ? 'I' : */ 'S';
++ else
++ recs[Position].Status = 'D';
++ break;
++
++ case SRUN:
++ case SIDL:
++ recs[Position].Status = 'R';
++ break;
++
++ case SWAIT:
++ recs[Position].Status = 'W';
++ break;
++
++ case SLOCK:
++ recs[Position].Status = 'L';
++ break;
++
++ case SZOMB:
++ recs[Position].Status = 'Z';
++ break;
++
++ default:
++ recs[Position].Status = '?';
++ }
++ } else {
++ Remove(Position);
++ }
++ free(kipp);
++ return ret;
++#endif
+ }
+
+ bool cStatusMarkAd::getPid(int Position)
Index: head/multimedia/vdr-plugin-markad/files/patch-vdr-markad-0.1.4-libav9
===================================================================
--- head/multimedia/vdr-plugin-markad/files/patch-vdr-markad-0.1.4-libav9
+++ head/multimedia/vdr-plugin-markad/files/patch-vdr-markad-0.1.4-libav9
@@ -1,40 +0,0 @@
-diff -urN markad-0.1.4.old/command/decoder.cpp markad-0.1.4/command/decoder.cpp
---- markad-0.1.4.old/command/decoder.cpp 2013-06-17 21:52:44.333367552 +0200
-+++ markad-0.1.4/command/decoder.cpp 2013-06-17 21:53:03.708366863 +0200
-@@ -11,6 +11,7 @@
- #include <sys/types.h>
- #include <string.h>
- #include <cstdlib>
-+#include <stdio.h>
-
- #include "decoder.h"
-
-@@ -172,7 +173,7 @@
-
- if (video_codec)
- {
-- video_context = avcodec_alloc_context();
-+ video_context = avcodec_alloc_context3(NULL);
- if (video_context)
- {
- if (video_codec->capabilities & CODEC_CAP_TRUNCATED)
-@@ -321,7 +322,7 @@
- {
- avcodec_flush_buffers(video_context);
- AVCodecContext *dest;
-- dest=avcodec_alloc_context();
-+ dest=avcodec_alloc_context3(NULL);
- if (dest)
- {
- if (avcodec_copy_context(dest,video_context)!=0) ret=false;
-diff -urN markad-0.1.4.old/command/decoder.h markad-0.1.4/command/decoder.h
---- markad-0.1.4.old/command/decoder.h 2013-06-17 21:52:44.333367552 +0200
-+++ markad-0.1.4/command/decoder.h 2013-06-17 21:53:03.708366863 +0200
-@@ -18,6 +18,7 @@
- #include <avcodec.h>
- #else
- #include <libavcodec/avcodec.h>
-+#include <libavutil/mem.h>
- #endif
-
- #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 8, 2:20 PM (16 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29407833
Default Alt Text
D6283.diff (33 KB)

Event Timeline