1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00

- Merge author's version of my zapping fix from git head.

- Bump PORTREVISION.
This commit is contained in:
Juergen Lock 2011-12-19 19:27:52 +00:00
parent fb154f9244
commit 187a6d5fb0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=287662
2 changed files with 76 additions and 0 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= vdr-plugin-xvdr
PORTVERSION= 0.9.5
PORTREVISION= 1
CATEGORIES= multimedia
MASTER_SITES= LOCAL/nox/
DISTNAME= pipelka-${PORTNAME}-xvdr-${PORTVERSION}-0-g${GITHASH}

View File

@ -0,0 +1,75 @@
commit 81bde12cd5d36a5bb0f1bc5791977b58cc34f91e
Author: Alexander Pipelka <alexander.pipelka@gmail.com>
Date: Mon Dec 19 10:30:16 2011 +0100
wait until streaming stopped before switching to a new channel, thanks Juergen Lock
diff --git a/src/xvdr/xvdrclient.c b/src/xvdr/xvdrclient.c
index ced735e..8078454 100644
--- a/src/xvdr/xvdrclient.c
+++ b/src/xvdr/xvdrclient.c
@@ -72,6 +72,7 @@ static uint32_t recid2uid(const char* recid)
}
cMutex cXVDRClient::m_timerLock;
+cMutex cXVDRClient::m_switchLock;
cXVDRClient::cXVDRClient(int fd, unsigned int id, const char *ClientAdr)
{
@@ -183,6 +184,7 @@ void cXVDRClient::Action(void)
bool cXVDRClient::StartChannelStreaming(const cChannel *channel, uint32_t timeout)
{
+ cMutexLock lock(&m_switchLock);
m_Streamer = new cLiveStreamer(timeout);
m_Streamer->SetLanguage(m_LanguageIndex, m_LangStreamType);
@@ -192,12 +194,10 @@ bool cXVDRClient::StartChannelStreaming(const cChannel *channel, uint32_t timeou
void cXVDRClient::StopChannelStreaming()
{
+ cMutexLock lock(&m_switchLock);
+ delete m_Streamer;
+ m_Streamer = NULL;
m_isStreaming = false;
- if (m_Streamer)
- {
- delete m_Streamer;
- m_Streamer = NULL;
- }
}
void cXVDRClient::TimerChange(const cTimer *Timer, eTimerChange Change)
@@ -640,8 +640,7 @@ bool cXVDRClient::processChannelStream_Open() /* OPCODE 20 */
if(timeout == 0)
timeout = XVDRServerConfig.stream_timeout;
- if (m_isStreaming)
- StopChannelStreaming();
+ StopChannelStreaming();
Channels.Lock(false);
const cChannel *channel = NULL;
@@ -679,9 +678,7 @@ bool cXVDRClient::processChannelStream_Open() /* OPCODE 20 */
bool cXVDRClient::processChannelStream_Close() /* OPCODE 21 */
{
- if (m_isStreaming)
- StopChannelStreaming();
-
+ StopChannelStreaming();
return true;
}
diff --git a/src/xvdr/xvdrclient.h b/src/xvdr/xvdrclient.h
index e602c70..99bae64 100644
--- a/src/xvdr/xvdrclient.h
+++ b/src/xvdr/xvdrclient.h
@@ -64,6 +64,7 @@ private:
uint32_t m_protocolVersion;
cMutex m_msgLock;
static cMutex m_timerLock;
+ static cMutex m_switchLock;
int m_compressionLevel;
int m_LanguageIndex;
eStreamType m_LangStreamType;