1
0
mirror of https://github.com/rofafor/vdr-plugin-iptv.git synced 2023-10-10 13:37:03 +02:00

Fixed shutdown crash.

This commit is contained in:
Rolf Ahrenberg 2007-10-22 16:22:11 +00:00
parent 8e979d2940
commit eb1cd9b01a
4 changed files with 25 additions and 12 deletions

View File

@ -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.

View File

@ -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);

View File

@ -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());
}

4
iptv.c
View File

@ -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 <getopt.h>
@ -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 {