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

Fixed channel switching in UDP protocol.

This commit is contained in:
Rolf Ahrenberg 2012-03-30 19:01:46 +03:00
parent 4c39d8cf72
commit ff84c54d50
3 changed files with 7 additions and 6 deletions

View File

@ -162,3 +162,4 @@ VDR Plugin 'iptv' Revision History
2012-03-25: Version 0.5.1 2012-03-25: Version 0.5.1
- Updated for vdr-1.7.27. - Updated for vdr-1.7.27.
- Fixed channel switching in UDP protocol.

View File

@ -42,6 +42,6 @@ void cIptvConfig::SetDisabledFilters(unsigned int Index, int Number)
void cIptvConfig::SetConfigDirectory(const char *directoryP) void cIptvConfig::SetConfigDirectory(const char *directoryP)
{ {
debug("cIptvConfig::SetConfigDirectory(%s)", directoryP); debug("cIptvConfig::SetConfigDirectory(%s)\n", directoryP);
ERROR_IF(!realpath(directoryP, configDirectory), "Cannot canonicalize configuration directory"); ERROR_IF(!realpath(directoryP, configDirectory), "Cannot canonicalize configuration directory");
} }

View File

@ -37,7 +37,7 @@ cIptvProtocolUdp::~cIptvProtocolUdp()
bool cIptvProtocolUdp::Open(void) bool cIptvProtocolUdp::Open(void)
{ {
debug("cIptvProtocolUdp::Open()\n"); debug("cIptvProtocolUdp::Open(): sourceAddr=%s streamAddr=%s\n", sourceAddr, streamAddr);
OpenSocket(socketPort, isempty(sourceAddr) ? INADDR_ANY : inet_addr(sourceAddr)); OpenSocket(socketPort, isempty(sourceAddr) ? INADDR_ANY : inet_addr(sourceAddr));
if (!isempty(streamAddr)) { if (!isempty(streamAddr)) {
// Join a new multicast group // Join a new multicast group
@ -48,7 +48,7 @@ bool cIptvProtocolUdp::Open(void)
bool cIptvProtocolUdp::Close(void) bool cIptvProtocolUdp::Close(void)
{ {
debug("cIptvProtocolUdp::Close()\n"); debug("cIptvProtocolUdp::Close(): sourceAddr=%s streamAddr=%s\n", sourceAddr, streamAddr);
if (!isempty(streamAddr)) { if (!isempty(streamAddr)) {
// Drop the multicast group // Drop the multicast group
OpenSocket(socketPort, isempty(sourceAddr) ? INADDR_ANY : inet_addr(sourceAddr)); OpenSocket(socketPort, isempty(sourceAddr) ? INADDR_ANY : inet_addr(sourceAddr));
@ -56,9 +56,9 @@ bool cIptvProtocolUdp::Close(void)
} }
// Close the socket // Close the socket
CloseSocket(); CloseSocket();
// Reset stream and source addresses // Do NOT reset stream and source addresses
streamAddr = strcpyrealloc(streamAddr, ""); //streamAddr = strcpyrealloc(streamAddr, "");
sourceAddr = strcpyrealloc(sourceAddr, ""); //sourceAddr = strcpyrealloc(sourceAddr, "");
return true; return true;
} }