zapit/src/channel.cpp: comment privatePid usage, use enum for service type

This commit is contained in:
[CST] Focus
2012-03-29 17:26:34 +04:00
parent 647b7580a8
commit c0bb4e7e61
2 changed files with 8 additions and 7 deletions

View File

@@ -126,7 +126,7 @@ class CZapitChannel
unsigned short teletextPid;
unsigned short videoPid;
unsigned short audioPid;
unsigned short privatePid;
/*unsigned short privatePid;*/
/* set true when pids are set up */
bool pidsFlag;
@@ -203,7 +203,7 @@ class CZapitChannel
unsigned short getTeletextPid(void) { return teletextPid; }
const char * getTeletextLang(void) { return ttx_language_code.c_str(); }
unsigned short getVideoPid(void) { return videoPid; }
unsigned short getPrivatePid(void) { return privatePid; }
/*unsigned short getPrivatePid(void) { return privatePid; }*/
unsigned short getPreAudioPid(void) { return audioPid; }
bool getPidsFlag(void) { return pidsFlag; }
//CCaPmt * getCaPmt(void) { return caPmt; }
@@ -226,7 +226,7 @@ class CZapitChannel
void setTeletextLang(std::string lang) { ttx_language_code = lang; };
void setVideoPid(unsigned short pVideoPid) { videoPid = pVideoPid; }
void setAudioPid(unsigned short pAudioPid) { audioPid = pAudioPid; }
void setPrivatePid(unsigned short pPrivatePid) { privatePid = pPrivatePid; }
/*void setPrivatePid(unsigned short pPrivatePid) { privatePid = pPrivatePid; }*/
void setPidsFlag(void) { pidsFlag = true; }
//void setCaPmt(CCaPmt *pCaPmt);
void setPmtVersion(uint8_t version) { pmt_version = version; }

View File

@@ -138,7 +138,7 @@ void CZapitChannel::resetPids(void)
videoPid = 0;
audioPid = 0;
privatePid = 0;
/*privatePid = 0;*/
pidsFlag = false;
std::vector<CZapitAbsSub *>::iterator subI;
for (subI = channelSubs.begin(); subI != channelSubs.end(); subI++){
@@ -153,7 +153,8 @@ unsigned char CZapitChannel::getServiceType(bool real)
if(real)
return serviceType;
else
return serviceType == 2 ? 2 : 1;
return serviceType == ST_DIGITAL_RADIO_SOUND_SERVICE ?
ST_DIGITAL_RADIO_SOUND_SERVICE : ST_DIGITAL_TELEVISION_SERVICE;
}
bool CZapitChannel::isHD()
@@ -162,7 +163,7 @@ bool CZapitChannel::isHD()
case 0x11: case 0x19:
//printf("[zapit] HD channel: %s type 0x%X\n", name.c_str(), serviceType);
return true;
case 0x1: {
case ST_DIGITAL_TELEVISION_SERVICE: {
char * temp = (char *) name.c_str();
int len = name.size();
if((len > 1) && temp[len-2] == 'H' && temp[len-1] == 'D') {
@@ -171,7 +172,7 @@ bool CZapitChannel::isHD()
}
return false;
}
case 0x2:
case ST_DIGITAL_RADIO_SOUND_SERVICE:
return false;
default:
//printf("[zapit] Unknown channel type 0x%X name %s !!!!!!\n", serviceType, name.c_str());