diff --git a/HISTORY b/HISTORY index 8824cc4..3b18364 100644 --- a/HISTORY +++ b/HISTORY @@ -11,3 +11,7 @@ VDR Plugin 'iptv' Revision History - Added Spids to channel editor. - Fixed shutdown logic. - Improved error checking in protocols. + +2007-xx-xx: Version 0.0.3 + +- Fixed shutdown crash. diff --git a/common.h b/common.h index 1a68857..828a38c 100644 --- a/common.h +++ b/common.h @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: common.h,v 1.13 2007/10/20 23:25:14 ajhseppa Exp $ + * $Id: common.h,v 1.14 2007/10/22 16:22:11 rahrenbe Exp $ */ #ifndef __IPTV_COMMON_H @@ -44,6 +44,15 @@ #define ERROR_IF(exp, errstr) ERROR_IF_FUNC(exp, errstr, , ); +#define DELETE_POINTER(ptr, type) \ + do { \ + if (ptr) { \ + type *tmp = ptr; \ + ptr = NULL; \ + delete(tmp); \ + } \ + } while (0) + uint16_t ts_pid(const uint8_t *buf); uint8_t payload(const uint8_t *tsp); const char *id_pid(const u_short Pid); diff --git a/device.c b/device.c index f039536..4a7e2df 100644 --- a/device.c +++ b/device.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: device.c,v 1.72 2007/10/20 20:35:06 rahrenbe Exp $ + * $Id: device.c,v 1.73 2007/10/22 16:22:11 rahrenbe Exp $ */ #include "config.h" @@ -45,16 +45,16 @@ cIptvDevice::cIptvDevice(unsigned int Index) cIptvDevice::~cIptvDevice() { debug("cIptvDevice::~cIptvDevice(%d)\n", deviceIndex); - DELETENULL(pIptvStreamer); - DELETENULL(pUdpProtocol); - DELETENULL(pHttpProtocol); - DELETENULL(pFileProtocol); - DELETENULL(pExtProtocol); - DELETENULL(tsBuffer); + DELETE_POINTER(pIptvStreamer, cIptvStreamer); + DELETE_POINTER(pUdpProtocol, cIptvProtocolUdp); + DELETE_POINTER(pHttpProtocol, cIptvProtocolHttp); + DELETE_POINTER(pFileProtocol, cIptvProtocolFile); + DELETE_POINTER(pExtProtocol, cIptvProtocolExt); + DELETE_POINTER(tsBuffer, cRingBufferLinear); // Detach and destroy sid filter if (pSidScanner) { Detach(pSidScanner); - DELETENULL(pSidScanner); + DELETE_POINTER(pSidScanner, cSidScanner); } // Destroy all filters for (int i = 0; i < eMaxSecFilterCount; ++i) @@ -103,7 +103,7 @@ cString cIptvDevice::GetGeneralInformation(void) deviceIndex, CardIndex(), pIptvStreamer ? *pIptvStreamer->GetInformation() : "", pIptvStreamer ? *pIptvStreamer->GetStatistic() : "", - *cIptvBufferStatistics::GetStatistic(), + *cIptvBufferStatistics::GetStatistic(), *Channels.GetByNumber(cDevice::CurrentChannel())->ToText()); } diff --git a/iptv.c b/iptv.c index cc543ee..97fd769 100644 --- a/iptv.c +++ b/iptv.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: iptv.c,v 1.24 2007/10/20 17:26:46 rahrenbe Exp $ + * $Id: iptv.c,v 1.25 2007/10/22 16:22:11 rahrenbe Exp $ */ #include @@ -17,7 +17,7 @@ #error "VDR-1.5.10 API version or greater is required!" #endif -static const char *VERSION = "0.0.2"; +static const char *VERSION = "0.0.3"; static const char *DESCRIPTION = trNOOP("Experience the IPTV"); class cPluginIptv : public cPlugin {