fix capmt refcounting if switching to unlocked channel

CRemoteControl::startvideo() and stopvideo() did trigger a resend
of the capmt, which lead to refcounting issues. Fix this by adding
parameters to lock/unlockPlayback to disable the sending of capmt
and set this in start/stopvideo.
This commit is contained in:
Stefan Seyfried
2012-07-07 19:50:59 +02:00
parent d3920eb21d
commit e52cc57efb
4 changed files with 48 additions and 18 deletions

View File

@@ -4,6 +4,8 @@
Copyright (C) 2001 Steffen Hehn 'McClean'
Homepage: http://dbox.cyberphoria.org/
(C) 2008-2012 Stefan Seyfried
Kommentar:
Diese GUI wurde von Grund auf neu programmiert und sollte nun vom
@@ -688,7 +690,7 @@ void CRemoteControl::startvideo()
{
is_video_started= true;
//g_Zapit->startPlayBack();
g_Zapit->unlockPlayBack();
g_Zapit->unlockPlayBack(false);
}
}
@@ -700,9 +702,9 @@ void CRemoteControl::stopvideo()
#if HAVE_TRIPLEDRAGON
/* we need stopPlayback to blank video,
lockPlayback prevents it from being inadvertently starting */
g_Zapit->stopPlayBack();
g_Zapit->stopPlayBack(false);
#endif
g_Zapit->lockPlayBack();
g_Zapit->lockPlayBack(false);
}
}

View File

@@ -481,10 +481,10 @@ class CZapitClient:public CBasicClient
/****************************************/
void setStandby(const bool enable);
void startPlayBack();
void stopPlayBack();
void lockPlayBack();
void unlockPlayBack();
void startPlayBack(const bool sendpmt = false);
void stopPlayBack(const bool sendpmt = false);
void lockPlayBack(const bool sendpmt = true);
void unlockPlayBack(const bool sendpmt = true);
bool tune_TP(TP_params TP);
bool isPlayBackActive();
void setDisplayFormat(const video_display_format_t mode);

View File

@@ -4,6 +4,7 @@
* Zapit client interface - DBoxII-Project
*
* (C) 2002 by thegoodguy <thegoodguy@berlios.de> & the DBoxII-Project
* (C) 2007-2012 Stefan Seyfried
*
* License: GPL
*
@@ -935,30 +936,38 @@ void CZapitClient::setVideoSystem(int video_system)
}
void CZapitClient::startPlayBack()
void CZapitClient::startPlayBack(const bool sendpmt)
{
send(CZapitMessages::CMD_SB_START_PLAYBACK);
CZapitMessages::commandBoolean msg;
msg.truefalse = sendpmt;
send(CZapitMessages::CMD_SB_START_PLAYBACK, (char*)&msg, sizeof(msg));
close_connection();
}
void CZapitClient::stopPlayBack()
void CZapitClient::stopPlayBack(const bool sendpmt)
{
send(CZapitMessages::CMD_SB_STOP_PLAYBACK);
CZapitMessages::commandBoolean msg;
msg.truefalse = sendpmt;
send(CZapitMessages::CMD_SB_STOP_PLAYBACK, (char*)&msg, sizeof(msg));
CZapitMessages::responseCmd response;
CBasicClient::receive_data((char* )&response, sizeof(response));
close_connection();
}
void CZapitClient::lockPlayBack()
void CZapitClient::lockPlayBack(const bool sendpmt)
{
send(CZapitMessages::CMD_SB_LOCK_PLAYBACK);
CZapitMessages::commandBoolean msg;
msg.truefalse = sendpmt;
send(CZapitMessages::CMD_SB_LOCK_PLAYBACK, (char*)&msg, sizeof(msg));
CZapitMessages::responseCmd response;
CBasicClient::receive_data((char* )&response, sizeof(response));
close_connection();
}
void CZapitClient::unlockPlayBack()
void CZapitClient::unlockPlayBack(const bool sendpmt)
{
send(CZapitMessages::CMD_SB_UNLOCK_PLAYBACK);
CZapitMessages::commandBoolean msg;
msg.truefalse = sendpmt;
send(CZapitMessages::CMD_SB_UNLOCK_PLAYBACK, (char*)&msg, sizeof(msg));
CZapitMessages::responseCmd response;
CBasicClient::receive_data((char* )&response, sizeof(response));
close_connection();

View File

@@ -1333,32 +1333,51 @@ printf("[zapit] TP_id %d freq %d rate %d fec %d pol %d\n", TP.TP_id, TP.feparams
}
case CZapitMessages::CMD_SB_START_PLAYBACK:
{
CZapitMessages::commandBoolean msgBool;
CBasicServer::receive_data(connfd, &msgBool, sizeof(msgBool));
//playbackStopForced = false;
StartPlayBack(current_channel);
if (msgBool.truefalse)
SendPMT();
break;
}
case CZapitMessages::CMD_SB_STOP_PLAYBACK:
StopPlayBack(false);
{
CZapitMessages::commandBoolean msgBool;
CBasicServer::receive_data(connfd, &msgBool, sizeof(msgBool));
StopPlayBack(msgBool.truefalse);
response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response));
break;
}
case CZapitMessages::CMD_SB_LOCK_PLAYBACK:
{
CZapitMessages::commandBoolean msgBool;
CBasicServer::receive_data(connfd, &msgBool, sizeof(msgBool));
/* hack. if standby true, dont blank video */
standby = true;
StopPlayBack(true);
StopPlayBack(msgBool.truefalse);
standby = false;
playbackStopForced = true;
response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response));
break;
}
case CZapitMessages::CMD_SB_UNLOCK_PLAYBACK:
{
CZapitMessages::commandBoolean msgBool;
CBasicServer::receive_data(connfd, &msgBool, sizeof(msgBool));
playbackStopForced = false;
StartPlayBack(current_channel);
SendPMT();
if (msgBool.truefalse)
SendPMT();
response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response));
break;
}
case CZapitMessages::CMD_SET_DISPLAY_FORMAT: {
CZapitMessages::commandInt msg;
CBasicServer::receive_data(connfd, &msg, sizeof(msg));