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.


Origin commit data
------------------
Branch: ni/coolstream
Commit: e52cc57efb
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-07-07 (Sat, 07 Jul 2012)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2012-07-07 19:50:59 +02:00
parent a904e1032a
commit bfdcc9f800
4 changed files with 48 additions and 18 deletions

View File

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

View File

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

View File

@@ -4,6 +4,7 @@
* Zapit client interface - DBoxII-Project * Zapit client interface - DBoxII-Project
* *
* (C) 2002 by thegoodguy <thegoodguy@berlios.de> & the DBoxII-Project * (C) 2002 by thegoodguy <thegoodguy@berlios.de> & the DBoxII-Project
* (C) 2007-2012 Stefan Seyfried
* *
* License: GPL * 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(); 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; CZapitMessages::responseCmd response;
CBasicClient::receive_data((char* )&response, sizeof(response)); CBasicClient::receive_data((char* )&response, sizeof(response));
close_connection(); 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; CZapitMessages::responseCmd response;
CBasicClient::receive_data((char* )&response, sizeof(response)); CBasicClient::receive_data((char* )&response, sizeof(response));
close_connection(); 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; CZapitMessages::responseCmd response;
CBasicClient::receive_data((char* )&response, sizeof(response)); CBasicClient::receive_data((char* )&response, sizeof(response));
close_connection(); 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: case CZapitMessages::CMD_SB_START_PLAYBACK:
{
CZapitMessages::commandBoolean msgBool;
CBasicServer::receive_data(connfd, &msgBool, sizeof(msgBool));
//playbackStopForced = false; //playbackStopForced = false;
StartPlayBack(current_channel); StartPlayBack(current_channel);
if (msgBool.truefalse)
SendPMT();
break; break;
}
case CZapitMessages::CMD_SB_STOP_PLAYBACK: 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; response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response)); CBasicServer::send_data(connfd, &response, sizeof(response));
break; break;
}
case CZapitMessages::CMD_SB_LOCK_PLAYBACK: case CZapitMessages::CMD_SB_LOCK_PLAYBACK:
{
CZapitMessages::commandBoolean msgBool;
CBasicServer::receive_data(connfd, &msgBool, sizeof(msgBool));
/* hack. if standby true, dont blank video */ /* hack. if standby true, dont blank video */
standby = true; standby = true;
StopPlayBack(true); StopPlayBack(msgBool.truefalse);
standby = false; standby = false;
playbackStopForced = true; playbackStopForced = true;
response.cmd = CZapitMessages::CMD_READY; response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response)); CBasicServer::send_data(connfd, &response, sizeof(response));
break; break;
}
case CZapitMessages::CMD_SB_UNLOCK_PLAYBACK: case CZapitMessages::CMD_SB_UNLOCK_PLAYBACK:
{
CZapitMessages::commandBoolean msgBool;
CBasicServer::receive_data(connfd, &msgBool, sizeof(msgBool));
playbackStopForced = false; playbackStopForced = false;
StartPlayBack(current_channel); StartPlayBack(current_channel);
SendPMT(); if (msgBool.truefalse)
SendPMT();
response.cmd = CZapitMessages::CMD_READY; response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response)); CBasicServer::send_data(connfd, &response, sizeof(response));
break; break;
}
case CZapitMessages::CMD_SET_DISPLAY_FORMAT: { case CZapitMessages::CMD_SET_DISPLAY_FORMAT: {
CZapitMessages::commandInt msg; CZapitMessages::commandInt msg;
CBasicServer::receive_data(connfd, &msg, sizeof(msg)); CBasicServer::receive_data(connfd, &msg, sizeof(msg));