Update to 1.0.1 .

This commit is contained in:
Juergen Lock 2012-07-10 21:49:20 +00:00
parent 36b5a2c50e
commit fd0b262ba1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=300739
8 changed files with 18 additions and 146 deletions

View File

@ -6,8 +6,7 @@
#
PORTNAME= vdr-plugin-iptv
PORTVERSION= 0.5.2
PORTREVISION= 1
PORTVERSION= 1.0.1
CATEGORIES= multimedia
MASTER_SITES= http://www.saunalahti.fi/~rahrenbe/vdr/iptv/files/
DISTNAME= ${PORTNAME:S/-plugin-/-/}-${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}
@ -21,6 +20,7 @@ HAVE_CONFIGURE= yes
PORTDOCS= COPYING README HISTORY
PORTEXAMPLES= channels.conf.iptv
MAKE_JOBS_SAFE= yes
MAKE_ARGS+= IPTV_EXTSHELL=/bin/sh
WRKSRC= ${WRKDIR}/${PLUGIN}-${DISTVERSION}
.include "${.CURDIR}/../vdr/Makefile.plugins"

View File

@ -1,2 +1,2 @@
SHA256 (vdr/vdr-iptv-0.5.2.tgz) = dace607ccdf815ad9fc77e13567925c696b2974b8f34fdd87dcb026df3e56b77
SIZE (vdr/vdr-iptv-0.5.2.tgz) = 49632
SHA256 (vdr/vdr-iptv-1.0.1.tgz) = 2f6f468f44e6e8ab4d347459a43b8535a89b67a300c75080d9155341717476a8
SIZE (vdr/vdr-iptv-1.0.1.tgz) = 50035

View File

@ -1,6 +1,16 @@
--- a/Makefile
+++ b/Makefile
@@ -50,7 +50,8 @@ PACKAGE = vdr-$(ARCHIVE)
@@ -12,7 +12,8 @@
STRIP = strip
# Install command
-INSTALL = cp --remove-destination
+#INSTALL = cp --remove-destination
+INSTALL = cp -f
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
@@ -58,7 +58,8 @@ PACKAGE = vdr-$(ARCHIVE)
### Includes and Defines (add further entries here):
@ -10,22 +20,9 @@
DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
@@ -117,7 +118,11 @@ libvdr-$(PLUGIN).so: $(OBJS)
ifndef IPTV_DEBUG
@$(STRIP) $@
endif
+ifdef FREEBSD
+ @cp -f $@ $(LIBDIR)/$@.$(APIVERSION)
+else
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
+endif
@@ -148,3 +149,5 @@ clean:
dist: clean
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@@ -129,3 +134,6 @@ dist: clean
clean:
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
+
cppcheck: $(OBJS)
@cppcheck --enable=information,style,unusedFunction -v -f $(OBJS:%.o=%.c)
+install:
+ ${INSTALL_PROGRAM} $(LIBDIR)/libvdr-$(PLUGIN).so.$(APIVERSION) $(PREFIX)/lib/vdr/libvdr-$(PLUGIN).so.$(APIVERSION)

View File

@ -1,29 +0,0 @@
--- a/common.h
+++ b/common.h
@@ -36,6 +36,7 @@
#define SECTION_FILTER_TABLE_SIZE 7
+#ifndef __FreeBSD__
#define ERROR_IF_FUNC(exp, errstr, func, ret) \
do { \
if (exp) { \
@@ -45,6 +46,18 @@
ret; \
} \
} while (0)
+#else
+#define ERROR_IF_FUNC(exp, errstr, func, ret) \
+ do { \
+ if (exp) { \
+ char tmp[64]; \
+ strerror_r(errno, tmp, sizeof(tmp)); \
+ error(errstr": %s", tmp); \
+ func; \
+ ret; \
+ } \
+ } while (0)
+#endif
#define ERROR_IF_RET(exp, errstr, ret) ERROR_IF_FUNC(exp, errstr, ,ret);

View File

@ -1,46 +0,0 @@
--- a/protocolext.c
+++ b/protocolext.c
@@ -55,10 +55,17 @@ void cIptvProtocolExt::ExecuteScript(voi
// Execute the external script
cString cmd = cString::sprintf("%s %d %d", *scriptFile, scriptParameter, socketPort);
debug("cIptvProtocolExt::ExecuteScript(child): %s\n", *cmd);
+#ifdef linux
if (execl("/bin/bash", "sh", "-c", *cmd, (char *)NULL) == -1) {
error("Script execution failed: %s", *cmd);
_exit(-1);
}
+#else
+ if (execl("/bin/sh", "sh", "-c", *cmd, (char *)NULL) == -1) {
+ error("Script execution failed: %s", *cmd);
+ _exit(-1);
+ }
+#endif
_exit(0);
}
else {
@@ -86,6 +93,7 @@ void cIptvProtocolExt::TerminateScript(v
error("Script '%s' won't terminate - killing it!", *scriptFile);
kill(pid, SIGKILL);
}
+#ifdef linux
// Clear wait status to make sure child exit status is accessible
memset(&waitStatus, '\0', sizeof(waitStatus));
// Wait for child termination
@@ -98,6 +106,17 @@ void cIptvProtocolExt::TerminateScript(v
debug("Child (%d) exited as expected\n", pid);
waitOver = true;
}
+#else
+ int status = 0;
+ retval = waitpid(pid, &status, (WNOHANG));
+ ERROR_IF_RET(retval < 0, "waitid()", waitOver = true);
+ // These are the acceptable conditions under which child exit is
+ // regarded as successful
+ if (!retval && (WIFEXITED(status) || WIFSIGNALED(status))) {
+ debug("Child (%d) exited as expected\n", pid);
+ waitOver = true;
+ }
+#endif
// Unsuccessful wait, avoid busy looping
if (!waitOver)
cCondWait::SleepMs(timeoutms);

View File

@ -1,10 +0,0 @@
--- a/sectionfilter.h
+++ b/sectionfilter.h
@@ -9,6 +9,7 @@
#define __IPTV_SECTIONFILTER_H
#include <vdr/device.h>
+#include <sys/socket.h>
#include "common.h"
#include "statistics.h"

View File

@ -1,30 +0,0 @@
--- a/socket.c
+++ b/socket.c
@@ -57,9 +57,11 @@ bool cIptvSocket::OpenSocket(const int P
// Allow multiple sockets to use the same PORT number
ERROR_IF_FUNC(setsockopt(socketDesc, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0, "setsockopt(SO_REUSEADDR)",
CloseSocket(), return false);
+#ifndef __FreeBSD__
// Allow packet information to be fetched
ERROR_IF_FUNC(setsockopt(socketDesc, SOL_IP, IP_PKTINFO, &yes, sizeof(yes)) < 0, "setsockopt(IP_PKTINFO)",
CloseSocket(), return false);
+#endif
// Bind socket
memset(&sockAddr, '\0', sizeof(sockAddr));
sockAddr.sin_family = AF_INET;
@@ -180,6 +182,7 @@ int cIptvUdpSocket::Read(unsigned char*
}
else if (len > 0) {
// Process auxiliary received data and validate source address
+#ifndef __FreeBSD__
for (cmsg = CMSG_FIRSTHDR(&msgh); (streamAddr != INADDR_ANY) && (cmsg != NULL); cmsg = CMSG_NXTHDR(&msgh, cmsg)) {
if ((cmsg->cmsg_level == SOL_IP) && (cmsg->cmsg_type == IP_PKTINFO)) {
struct in_pktinfo *i = (struct in_pktinfo *)CMSG_DATA(cmsg);
@@ -189,6 +192,7 @@ int cIptvUdpSocket::Read(unsigned char*
}
}
}
+#endif
if (BufferAddr[0] == TS_SYNC_BYTE)
return len;
else if (len > 3) {

View File

@ -1,10 +0,0 @@
--- a/socket.h
+++ b/socket.h
@@ -9,6 +9,7 @@
#define __IPTV_SOCKET_H
#include <arpa/inet.h>
+#include <netinet/in.h>
class cIptvSocket {
protected: