suppress some basicclient valgrind warnings

To enable these paranoia memsets for testing, compile with
-DPEDANTIC_VALGRIND_SETUP. Probably more of not completely
initialized structs are present in other parts of the code.
This is probably not useful for productive builds.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 8e46250c7c
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-10-31 (Wed, 31 Oct 2012)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2012-10-31 18:29:40 +01:00
parent 0a7ec205c4
commit fcc5c347c3
4 changed files with 97 additions and 0 deletions

View File

@@ -28,6 +28,11 @@
#include <sectionsdclient/sectionsdclient.h>
#include <sectionsdclient/sectionsdMsg.h>
#ifdef PEDANTIC_VALGRIND_SETUP
#define VALGRIND_PARANOIA(x) memset(&x, 0, sizeof(x))
#else
#define VALGRIND_PARANOIA(x) {}
#endif
unsigned char CSectionsdClient::getVersion () const
{
@@ -59,6 +64,7 @@ int CSectionsdClient::readResponse(char* data,unsigned int size)
bool CSectionsdClient::send(const unsigned char command, const char* data, const unsigned int size)
{
sectionsd::msgRequestHeader msgHead;
VALGRIND_PARANOIA(msgHead);
msgHead.version = getVersion();
msgHead.command = command;
@@ -78,6 +84,7 @@ bool CSectionsdClient::send(const unsigned char command, const char* data, const
void CSectionsdClient::registerEvent(const unsigned int eventID, const unsigned int clientID, const char * const udsName)
{
CEventServer::commandRegisterEvent msg2;
VALGRIND_PARANOIA(msg2);
msg2.eventID = eventID;
msg2.clientID = clientID;
@@ -92,6 +99,7 @@ void CSectionsdClient::registerEvent(const unsigned int eventID, const unsigned
void CSectionsdClient::unRegisterEvent(const unsigned int eventID, const unsigned int clientID)
{
CEventServer::commandUnRegisterEvent msg2;
VALGRIND_PARANOIA(msg2);
msg2.eventID = eventID;
msg2.clientID = clientID;
@@ -150,6 +158,7 @@ bool CSectionsdClient::getIsScanningActive()
void CSectionsdClient::setServiceChanged(const t_channel_id channel_id, const bool requestEvent)
{
sectionsd::commandSetServiceChanged msg;
VALGRIND_PARANOIA(msg);
msg.channel_id = channel_id;
msg.requestEvent = requestEvent;

View File

@@ -28,6 +28,11 @@
#include <timerdclient/timerdmsg.h>
#include <timerdclient/timerdclient.h>
#ifdef PEDANTIC_VALGRIND_SETUP
#define VALGRIND_PARANOIA(x) memset(&x, 0, sizeof(x))
#else
#define VALGRIND_PARANOIA(x) {}
#endif
unsigned char CTimerdClient::getVersion () const
{
@@ -44,6 +49,7 @@ const char * CTimerdClient::getSocketName() const
void CTimerdClient::registerEvent(unsigned int eventID, unsigned int clientID, const char * const udsName)
{
CEventServer::commandRegisterEvent msg2;
VALGRIND_PARANOIA(msg2);
msg2.eventID = eventID;
msg2.clientID = clientID;
@@ -59,6 +65,7 @@ void CTimerdClient::registerEvent(unsigned int eventID, unsigned int clientID, c
void CTimerdClient::unRegisterEvent(unsigned int eventID, unsigned int clientID)
{
CEventServer::commandUnRegisterEvent msg2;
VALGRIND_PARANOIA(msg2);
msg2.eventID = eventID;
msg2.clientID = clientID;
@@ -166,6 +173,7 @@ bool CTimerdClient::modifyTimerEvent(int eventid, time_t announcetime, time_t al
// set new time values for event eventid
CTimerdMsg::commandModifyTimer msgModifyTimer;
VALGRIND_PARANOIA(msgModifyTimer);
msgModifyTimer.eventID = eventid;
msgModifyTimer.announceTime = announcetime;
msgModifyTimer.alarmTime = alarmtime;
@@ -204,6 +212,7 @@ bool CTimerdClient::rescheduleTimerEvent(int eventid, time_t diff)
bool CTimerdClient::rescheduleTimerEvent(int eventid, time_t announcediff, time_t alarmdiff, time_t stopdiff)
{
CTimerdMsg::commandModifyTimer msgModifyTimer;
VALGRIND_PARANOIA(msgModifyTimer);
msgModifyTimer.eventID = eventid;
msgModifyTimer.announceTime = announcediff;
msgModifyTimer.alarmTime = alarmdiff;
@@ -257,6 +266,9 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data,
CTimerd::TransferEventInfo tei;
CTimerd::TransferRecordingInfo tri;
CTimerdMsg::commandAddTimer msgAddTimer;
VALGRIND_PARANOIA(tei);
VALGRIND_PARANOIA(tri);
VALGRIND_PARANOIA(msgAddTimer);
msgAddTimer.alarmTime = alarmtime;
msgAddTimer.announceTime = announcetime;
msgAddTimer.stopTime = stoptime;
@@ -325,6 +337,7 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data,
void CTimerdClient::removeTimerEvent( int evId)
{
CTimerdMsg::commandRemoveTimer msgRemoveTimer;
VALGRIND_PARANOIA(msgRemoveTimer);
msgRemoveTimer.eventID = evId;
@@ -394,6 +407,7 @@ bool CTimerdClient::shutdown()
void CTimerdClient::modifyTimerAPid(int eventid, unsigned char apids)
{
CTimerdMsg::commandSetAPid data;
VALGRIND_PARANOIA(data);
data.eventID=eventid;
data.apids = apids;
send(CTimerdMsg::CMD_SETAPID, (char*) &data, sizeof(data));
@@ -404,6 +418,7 @@ void CTimerdClient::modifyTimerAPid(int eventid, unsigned char apids)
void CTimerdClient::setRecordingSafety(int pre, int post)
{
CTimerdMsg::commandRecordingSafety data;
VALGRIND_PARANOIA(data);
data.pre = pre;
data.post = post;
send(CTimerdMsg::CMD_SETRECSAFETY, (char*) &data, sizeof(data));
@@ -473,6 +488,7 @@ void CTimerdClient::setWeekdaysToStr(CTimerd::CTimerEventRepeat rep, char* str)
void CTimerdClient::stopTimerEvent( int evId)
{
CTimerdMsg::commandRemoveTimer msgRemoveTimer;
VALGRIND_PARANOIA(msgRemoveTimer);
msgRemoveTimer.eventID = evId;

View File

@@ -36,6 +36,12 @@
#include <zapit/client/msgtypes.h>
#include <zapit/client/zapittools.h>
#ifdef PEDANTIC_VALGRIND_SETUP
#define VALGRIND_PARANOIA memset(&msg, 0, sizeof(msg))
#else
#define VALGRIND_PARANOIA {}
#endif
unsigned char CZapitClient::getVersion() const
{
return CZapitMessages::ACTVERSION;
@@ -63,6 +69,7 @@ void CZapitClient::shutdown()
void CZapitClient::zapTo(const unsigned int bouquet, const unsigned int channel)
{
CZapitMessages::commandZapto msg;
VALGRIND_PARANOIA;
msg.bouquet = bouquet;
msg.channel = channel - 1;
@@ -76,6 +83,7 @@ void CZapitClient::zapTo(const unsigned int bouquet, const unsigned int channel)
void CZapitClient::zapTo(const unsigned int channel)
{
CZapitMessages::commandZaptoChannelNr msg;
VALGRIND_PARANOIA;
msg.channel = channel - 1;
@@ -137,6 +145,7 @@ int32_t CZapitClient::getCurrentSatellitePosition(void)
void CZapitClient::setAudioChannel(const unsigned int channel)
{
CZapitMessages::commandSetAudioChannel msg;
VALGRIND_PARANOIA;
msg.channel = channel;
@@ -149,6 +158,7 @@ void CZapitClient::setAudioChannel(const unsigned int channel)
unsigned int CZapitClient::zapTo_serviceID(const t_channel_id channel_id)
{
CZapitMessages::commandZaptoServiceID msg;
VALGRIND_PARANOIA;
msg.channel_id = channel_id;
msg.record = false;
@@ -166,6 +176,7 @@ unsigned int CZapitClient::zapTo_serviceID(const t_channel_id channel_id)
unsigned int CZapitClient::zapTo_record(const t_channel_id channel_id)
{
CZapitMessages::commandZaptoServiceID msg;
VALGRIND_PARANOIA;
msg.channel_id = channel_id;
msg.record = true;
@@ -183,6 +194,7 @@ unsigned int CZapitClient::zapTo_record(const t_channel_id channel_id)
unsigned int CZapitClient::zapTo_subServiceID(const t_channel_id channel_id)
{
CZapitMessages::commandZaptoServiceID msg;
VALGRIND_PARANOIA;
msg.channel_id = channel_id;
@@ -200,6 +212,7 @@ unsigned int CZapitClient::zapTo_subServiceID(const t_channel_id channel_id)
void CZapitClient::zapTo_serviceID_NOWAIT(const t_channel_id channel_id)
{
CZapitMessages::commandZaptoServiceID msg;
VALGRIND_PARANOIA;
msg.channel_id = channel_id;
@@ -212,6 +225,7 @@ void CZapitClient::zapTo_serviceID_NOWAIT(const t_channel_id channel_id)
void CZapitClient::zapTo_subServiceID_NOWAIT(const t_channel_id channel_id)
{
CZapitMessages::commandZaptoServiceID msg;
VALGRIND_PARANOIA;
msg.channel_id = channel_id;
@@ -224,6 +238,7 @@ void CZapitClient::zapTo_subServiceID_NOWAIT(const t_channel_id channel_id)
void CZapitClient::setMode(const channelsMode mode)
{
CZapitMessages::commandSetMode msg;
VALGRIND_PARANOIA;
msg.mode = mode;
@@ -283,6 +298,7 @@ void CZapitClient::getPIDS(responseGetPIDs& pids)
void CZapitClient::zaptoNvodSubService(const int num)
{
CZapitMessages::commandInt msg;
VALGRIND_PARANOIA;
msg.val = num;
@@ -298,6 +314,7 @@ void CZapitClient::getBouquets(BouquetList& bouquets, const bool emptyBouquetsTo
char buffer[30 + 1];
CZapitMessages::commandGetBouquets msg;
VALGRIND_PARANOIA;
msg.emptyBouquetsToo = emptyBouquetsToo;
msg.mode = mode;
@@ -384,6 +401,7 @@ bool CZapitClient::getBouquetChannels(const unsigned int bouquet, BouquetChannel
{
bool return_value;
CZapitMessages::commandGetBouquetChannels msg;
VALGRIND_PARANOIA;
msg.bouquet = bouquet;
msg.mode = mode;
@@ -414,6 +432,7 @@ bool CZapitClient::getChannels( BouquetChannelList& channels, channelsMode mode,
{
bool return_value;
CZapitMessages::commandGetChannels msg;
VALGRIND_PARANOIA;
msg.mode = mode;
msg.order = order;
@@ -488,6 +507,7 @@ void CZapitClient::reloadCurrentServices()
void CZapitClient::muteAudio(const bool mute)
{
CZapitMessages::commandBoolean msg;
VALGRIND_PARANOIA;
msg.truefalse = mute;
@@ -499,6 +519,7 @@ void CZapitClient::muteAudio(const bool mute)
bool CZapitClient::getMuteStatus()
{
CZapitMessages::commandBoolean msg;
VALGRIND_PARANOIA;
send(CZapitMessages::CMD_GET_MUTE_STATUS, (char*)&msg, sizeof(msg));
CBasicClient::receive_data((char*)&msg, sizeof(msg));
@@ -509,6 +530,7 @@ bool CZapitClient::getMuteStatus()
void CZapitClient::setVolume(const unsigned int left, const unsigned int right)
{
CZapitMessages::commandVolume msg;
VALGRIND_PARANOIA;
msg.left = left;
msg.right = right;
@@ -521,6 +543,7 @@ void CZapitClient::setVolume(const unsigned int left, const unsigned int right)
void CZapitClient::getVolume(unsigned int *left, unsigned int *right)
{
CZapitMessages::commandVolume msg;
VALGRIND_PARANOIA;
send(CZapitMessages::CMD_GET_VOLUME, 0, 0);
@@ -561,6 +584,7 @@ bool CZapitClient::get_current_TP(TP_params* TP)
void CZapitClient::sendMotorCommand(uint8_t cmdtype, uint8_t address, uint8_t cmd, uint8_t num_parameters, uint8_t param1, uint8_t param2)
{
CZapitMessages::commandMotor msg;
VALGRIND_PARANOIA;
msg.cmdtype = cmdtype;
msg.address = address;
@@ -766,6 +790,7 @@ void CZapitClient::addBouquet(const char * const name)
void CZapitClient::moveBouquet(const unsigned int bouquet, const unsigned int newPos)
{
CZapitMessages::commandMoveBouquet msg;
VALGRIND_PARANOIA;
msg.bouquet = bouquet;
msg.newPos = newPos;
@@ -779,6 +804,7 @@ void CZapitClient::moveBouquet(const unsigned int bouquet, const unsigned int ne
void CZapitClient::deleteBouquet(const unsigned int bouquet)
{
CZapitMessages::commandDeleteBouquet msg;
VALGRIND_PARANOIA;
msg.bouquet = bouquet;
@@ -792,6 +818,7 @@ void CZapitClient::deleteBouquet(const unsigned int bouquet)
void CZapitClient::renameBouquet(const unsigned int bouquet, const char * const newName)
{
CZapitMessages::commandRenameBouquet msg;
VALGRIND_PARANOIA;
msg.bouquet = bouquet;
@@ -861,6 +888,7 @@ void CZapitClient::moveChannel( unsigned int bouquet, unsigned int oldPos, unsig
void CZapitClient::addChannelToBouquet(const unsigned int bouquet, const t_channel_id channel_id)
{
CZapitMessages::commandAddChannelToBouquet msg;
VALGRIND_PARANOIA;
msg.bouquet = bouquet;
msg.channel_id = channel_id;
@@ -875,6 +903,7 @@ void CZapitClient::addChannelToBouquet(const unsigned int bouquet, const t_chann
void CZapitClient::removeChannelFromBouquet(const unsigned int bouquet, const t_channel_id channel_id)
{
CZapitMessages::commandRemoveChannelFromBouquet msg;
VALGRIND_PARANOIA;
msg.bouquet = bouquet;
msg.channel_id = channel_id;
@@ -889,6 +918,7 @@ void CZapitClient::removeChannelFromBouquet(const unsigned int bouquet, const t_
void CZapitClient::setBouquetLock(const unsigned int bouquet, const bool lock)
{
CZapitMessages::commandBouquetState msg;
VALGRIND_PARANOIA;
msg.bouquet = bouquet;
msg.state = lock;
@@ -903,6 +933,7 @@ void CZapitClient::setBouquetLock(const unsigned int bouquet, const bool lock)
void CZapitClient::setBouquetHidden(const unsigned int bouquet, const bool hidden)
{
CZapitMessages::commandBouquetState msg;
VALGRIND_PARANOIA;
msg.bouquet = bouquet;
msg.state = hidden;
@@ -925,6 +956,7 @@ void CZapitClient::renumChannellist()
void CZapitClient::saveBouquets(const bool saveall)
{
CZapitMessages::commandBoolean msg;
VALGRIND_PARANOIA;
msg.truefalse = saveall;
send(CZapitMessages::CMD_BQ_SAVE_BOUQUETS, (char*)&msg, sizeof(msg));
@@ -938,6 +970,7 @@ void CZapitClient::saveBouquets(const bool saveall)
void CZapitClient::setStandby(const bool enable)
{
CZapitMessages::commandBoolean msg;
VALGRIND_PARANOIA;
msg.truefalse = enable;
send(CZapitMessages::CMD_SET_STANDBY, (char*)&msg, sizeof(msg));
CZapitMessages::responseCmd response;
@@ -948,6 +981,7 @@ void CZapitClient::setStandby(const bool enable)
void CZapitClient::setVideoSystem(int video_system)
{
CZapitMessages::commandInt msg;
VALGRIND_PARANOIA;
msg.val = video_system;
send(CZapitMessages::CMD_SET_VIDEO_SYSTEM, (char*)&msg, sizeof(msg));
close_connection();
@@ -956,6 +990,7 @@ void CZapitClient::setVideoSystem(int video_system)
void CZapitClient::startPlayBack(const bool sendpmt)
{
CZapitMessages::commandBoolean msg;
VALGRIND_PARANOIA;
msg.truefalse = sendpmt;
send(CZapitMessages::CMD_SB_START_PLAYBACK, (char*)&msg, sizeof(msg));
close_connection();
@@ -964,6 +999,7 @@ void CZapitClient::startPlayBack(const bool sendpmt)
void CZapitClient::stopPlayBack(const bool sendpmt)
{
CZapitMessages::commandBoolean msg;
VALGRIND_PARANOIA;
msg.truefalse = sendpmt;
send(CZapitMessages::CMD_SB_STOP_PLAYBACK, (char*)&msg, sizeof(msg));
CZapitMessages::responseCmd response;
@@ -974,6 +1010,7 @@ void CZapitClient::stopPlayBack(const bool sendpmt)
void CZapitClient::lockPlayBack(const bool sendpmt)
{
CZapitMessages::commandBoolean msg;
VALGRIND_PARANOIA;
msg.truefalse = sendpmt;
send(CZapitMessages::CMD_SB_LOCK_PLAYBACK, (char*)&msg, sizeof(msg));
CZapitMessages::responseCmd response;
@@ -983,6 +1020,7 @@ void CZapitClient::lockPlayBack(const bool sendpmt)
void CZapitClient::unlockPlayBack(const bool sendpmt)
{
CZapitMessages::commandBoolean msg;
VALGRIND_PARANOIA;
msg.truefalse = sendpmt;
send(CZapitMessages::CMD_SB_UNLOCK_PLAYBACK, (char*)&msg, sizeof(msg));
CZapitMessages::responseCmd response;
@@ -1012,6 +1050,7 @@ void CZapitClient::setDisplayFormat(const video_display_format_t format)
void CZapitClient::setAudioMode(const int mode)
{
CZapitMessages::commandInt msg;
VALGRIND_PARANOIA;
msg.val = mode;
send(CZapitMessages::CMD_SET_AUDIO_MODE, (char*)&msg, sizeof(msg));
close_connection();
@@ -1030,6 +1069,7 @@ void CZapitClient::getAudioMode(int * mode)
void CZapitClient::setRecordMode(const bool activate)
{
CZapitMessages::commandSetRecordMode msg;
VALGRIND_PARANOIA;
msg.activate = activate;
send(CZapitMessages::CMD_SET_RECORD_MODE, (char*)&msg, sizeof(msg));
close_connection();
@@ -1067,6 +1107,7 @@ void CZapitClient::getAspectRatio(int *ratio)
void CZapitClient::setAspectRatio(int ratio)
{
CZapitMessages::commandInt msg;
VALGRIND_PARANOIA;
msg.val = ratio;
send(CZapitMessages::CMD_SET_ASPECTRATIO, (char*)&msg, sizeof(msg));
close_connection();
@@ -1075,6 +1116,7 @@ void CZapitClient::setAspectRatio(int ratio)
void CZapitClient::getMode43(int *m43)
{
CZapitMessages::commandInt msg;
VALGRIND_PARANOIA;
send(CZapitMessages::CMD_GET_MODE43, 0, 0);
CBasicClient::receive_data((char* )&msg, sizeof(msg));
* m43 = msg.val;
@@ -1084,6 +1126,7 @@ void CZapitClient::getMode43(int *m43)
void CZapitClient::setMode43(int m43)
{
CZapitMessages::commandInt msg;
VALGRIND_PARANOIA;
msg.val = m43;
send(CZapitMessages::CMD_SET_MODE43, (char*)&msg, sizeof(msg));
close_connection();
@@ -1092,6 +1135,7 @@ void CZapitClient::setMode43(int m43)
void CZapitClient::registerEvent(const unsigned int eventID, const unsigned int clientID, const char * const udsName)
{
CEventServer::commandRegisterEvent msg;
VALGRIND_PARANOIA;
msg.eventID = eventID;
msg.clientID = clientID;
@@ -1106,6 +1150,7 @@ void CZapitClient::registerEvent(const unsigned int eventID, const unsigned int
void CZapitClient::unRegisterEvent(const unsigned int eventID, const unsigned int clientID)
{
CEventServer::commandUnRegisterEvent msg;
VALGRIND_PARANOIA;
msg.eventID = eventID;
msg.clientID = clientID;

View File

@@ -73,6 +73,12 @@
#include <libdvbsub/dvbsub.h>
#include <libtuxtxt/teletext.h>
#ifdef PEDANTIC_VALGRIND_SETUP
#define VALGRIND_PARANOIA(x) memset(&x, 0, sizeof(x))
#else
#define VALGRIND_PARANOIA(x) {}
#endif
/* globals */
int sig_delay = 2; // seconds between signal check
@@ -852,6 +858,7 @@ bool CZapit::StartFastScan(int scan_mode, int opid)
void CZapit::SendCmdReady(int connfd)
{
CZapitMessages::responseCmd response;
VALGRIND_PARANOIA(response);
response.cmd = CZapitMessages::CMD_READY;
CBasicServer::send_data(connfd, &response, sizeof(response));
}
@@ -892,6 +899,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_ZAPTO_SUBSERVICEID: {
CZapitMessages::commandZaptoServiceID msgZaptoServiceID;
CZapitMessages::responseZapComplete msgResponseZapComplete;
VALGRIND_PARANOIA(msgResponseZapComplete);
CBasicServer::receive_data(connfd, &msgZaptoServiceID, sizeof(msgZaptoServiceID));
if(msgZaptoServiceID.record) {
msgResponseZapComplete.zapStatus = ZapForRecord(msgZaptoServiceID.channel_id);
@@ -946,6 +954,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_GET_MODE: {
CZapitMessages::responseGetMode msgGetMode;
VALGRIND_PARANOIA(msgGetMode);
msgGetMode.mode = (CZapitClient::channelsMode) getMode();
CBasicServer::send_data(connfd, &msgGetMode, sizeof(msgGetMode));
break;
@@ -953,6 +962,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_GET_CURRENT_SERVICEID: {
CZapitMessages::responseGetCurrentServiceID msgCurrentSID;
VALGRIND_PARANOIA(msgCurrentSID);
msgCurrentSID.channel_id = (current_channel != 0) ? current_channel->getChannelID() : 0;
CBasicServer::send_data(connfd, &msgCurrentSID, sizeof(msgCurrentSID));
break;
@@ -960,6 +970,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_GET_CURRENT_SERVICEINFO: {
CZapitClient::CCurrentServiceInfo msgCurrentServiceInfo;
VALGRIND_PARANOIA(msgCurrentServiceInfo);
memset(&msgCurrentServiceInfo, 0, sizeof(CZapitClient::CCurrentServiceInfo));
if(current_channel) {
msgCurrentServiceInfo.onid = current_channel->getOriginalNetworkId();
@@ -990,6 +1001,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_GET_DELIVERY_SYSTEM: {
CZapitMessages::responseDeliverySystem response;
VALGRIND_PARANOIA(response);
switch (live_fe->getInfo()->type) {
case FE_QAM:
response.system = DVB_C;
@@ -1040,6 +1052,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_GET_CHANNEL_NAME: {
t_channel_id requested_channel_id;
CZapitMessages::responseGetChannelName response;
VALGRIND_PARANOIA(response);
CBasicServer::receive_data(connfd, &requested_channel_id, sizeof(requested_channel_id));
response.name[0] = 0;
CZapitChannel * channel = (requested_channel_id == 0) ? current_channel :
@@ -1169,6 +1182,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_SCANREADY: {
CZapitMessages::responseIsScanReady msgResponseIsScanReady;
VALGRIND_PARANOIA(msgResponseIsScanReady);
#if 0 //FIXME used only when scanning done using pzapit client, is it really needed ?
msgResponseIsScanReady.satellite = curr_sat;
msgResponseIsScanReady.transponder = found_transponders;
@@ -1183,6 +1197,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_SCANGETSATLIST: {
uint32_t satlength;
CZapitClient::responseGetSatelliteList sat;
VALGRIND_PARANOIA(sat);
satlength = sizeof(sat);
satellite_map_t satmap = CServiceManager::getInstance()->SatelliteList();
@@ -1268,6 +1283,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_GET_RECORD_MODE: {
CZapitMessages::responseGetRecordModeState msgGetRecordModeState;
VALGRIND_PARANOIA(msgGetRecordModeState);
msgGetRecordModeState.activated = (currentMode & RECORD_MODE);
CBasicServer::send_data(connfd, &msgGetRecordModeState, sizeof(msgGetRecordModeState));
break;
@@ -1276,6 +1292,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_SB_GET_PLAYBACK_ACTIVE: {
/* FIXME check if needed */
CZapitMessages::responseGetPlaybackState msgGetPlaybackState;
VALGRIND_PARANOIA(msgGetPlaybackState);
msgGetPlaybackState.activated = playing;
msgGetPlaybackState.activated = videoDecoder->getPlayState();
CBasicServer::send_data(connfd, &msgGetPlaybackState, sizeof(msgGetPlaybackState));
@@ -1310,6 +1327,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_BQ_EXISTS_BOUQUET: {
CZapitMessages::responseGeneralInteger responseInteger;
VALGRIND_PARANOIA(responseInteger);
char * name = CBasicServer::receive_string(connfd);
responseInteger.number = g_bouquetManager->existsBouquet(name);
@@ -1508,6 +1526,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_GET_ASPECTRATIO: {
CZapitMessages::commandInt msg;
VALGRIND_PARANOIA(msg);
aspectratio=videoDecoder->getAspectRatio();
msg.val = aspectratio;
CBasicServer::send_data(connfd, &msg, sizeof(msg));
@@ -1536,6 +1555,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
case CZapitMessages::CMD_GETPIDS: {
if (current_channel) {
CZapitClient::responseGetOtherPIDs responseGetOtherPIDs;
VALGRIND_PARANOIA(responseGetOtherPIDs);
responseGetOtherPIDs.vpid = current_channel->getVideoPid();
responseGetOtherPIDs.ecmpid = 0; // TODO: remove
responseGetOtherPIDs.vtxtpid = current_channel->getTeletextPid();
@@ -1634,6 +1654,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
}
case CZapitMessages::CMD_GET_VOLUME: {
CZapitMessages::commandVolume msgVolume;
VALGRIND_PARANOIA(msgVolume);
#if 0
msgVolume.left = volume_left;
msgVolume.right = volume_right;
@@ -1644,6 +1665,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
}
case CZapitMessages::CMD_GET_MUTE_STATUS: {
CZapitMessages::commandBoolean msgBoolean;
VALGRIND_PARANOIA(msgBoolean);
msgBoolean.truefalse = audioDecoder->getMuteStatus();
CBasicServer::send_data(connfd, &msgBoolean, sizeof(msgBoolean));
break;
@@ -1705,6 +1727,7 @@ void CZapit::addChannelToBouquet(const unsigned int bouquet, const t_channel_id
bool CZapit::send_data_count(int connfd, int data_count)
{
CZapitMessages::responseGeneralInteger responseInteger;
VALGRIND_PARANOIA(responseInteger);
responseInteger.number = data_count;
if (CBasicServer::send_data(connfd, &responseInteger, sizeof(responseInteger)) == false) {
ERROR("could not send any return");
@@ -1719,6 +1742,7 @@ void CZapit::sendAPIDs(int connfd)
return;
for (uint32_t i = 0; i < current_channel->getAudioChannelCount(); i++) {
CZapitClient::responseGetAPIDs response;
VALGRIND_PARANOIA(response);
response.pid = current_channel->getAudioPid(i);
strncpy(response.desc, current_channel->getAudioChannel(i)->description.c_str(), DESC_MAX_LEN-1);
response.is_ac3 = response.is_aac = 0;
@@ -1745,6 +1769,7 @@ void CZapit::internalSendChannels(int connfd, ZapitChannelList* channels, const
for (uint32_t i = 0; i < channels->size();i++) {
if(nonames) {
CZapitClient::responseGetBouquetNChannels response;
VALGRIND_PARANOIA(response);
response.nr = first_channel_nr + i;
if (CBasicServer::send_data(connfd, &response, sizeof(response)) == false) {
@@ -1756,6 +1781,7 @@ void CZapit::internalSendChannels(int connfd, ZapitChannelList* channels, const
}
} else {
CZapitClient::responseGetBouquetChannels response;
VALGRIND_PARANOIA(response);
strncpy(response.name, ((*channels)[i]->getName()).c_str(), CHANNEL_NAME_SIZE-1);
response.name[CHANNEL_NAME_SIZE-1] = 0;
//printf("internalSendChannels: name %s\n", response.name);
@@ -1778,6 +1804,7 @@ void CZapit::internalSendChannels(int connfd, ZapitChannelList* channels, const
void CZapit::sendBouquets(int connfd, const bool emptyBouquetsToo, CZapitClient::channelsMode mode)
{
CZapitClient::responseGetBouquets msgBouquet;
VALGRIND_PARANOIA(msgBouquet);
int curMode;
switch(mode) {
case CZapitClient::MODE_TV: