neutrino: add EAC3 audio support

This commit is contained in:
[CST] Focus
2013-10-08 17:18:24 +04:00
parent 6f07cbe3dd
commit 2e6276def7
8 changed files with 38 additions and 16 deletions

View File

@@ -481,7 +481,8 @@ void CRemoteControl::processAPIDnames()
pref_found = j;
pref_idx = i;
}
if(current_PIDs.APIDs[j].is_ac3 && g_settings.audio_DolbyDigital && (pref_ac3_found < 0)) {
if((current_PIDs.APIDs[j].is_ac3 || current_PIDs.APIDs[j].is_eac3)
&& g_settings.audio_DolbyDigital && (pref_ac3_found < 0)) {
pref_ac3_found = j;
pref_ac3_idx = i;
}
@@ -519,6 +520,8 @@ void CRemoteControl::processAPIDnames()
}
else if (current_PIDs.APIDs[count].is_aac && !strstr(current_PIDs.APIDs[count].desc, " (AAC)"))
strncat(current_PIDs.APIDs[count].desc, " (AAC)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)-1);
else if (current_PIDs.APIDs[count].is_eac3 && !strstr(current_PIDs.APIDs[count].desc, " (EAC3)"))
strncat(current_PIDs.APIDs[count].desc, " (EAC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)-1);
}
if ( has_unresolved_ctags )
@@ -544,6 +547,8 @@ void CRemoteControl::processAPIDnames()
strncat(current_PIDs.APIDs[j].desc, " (AC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1);
else if (current_PIDs.APIDs[j].is_aac && !strstr(current_PIDs.APIDs[j].desc, " (AAC)"))
strncat(current_PIDs.APIDs[j].desc, " (AAC)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1);
else if (current_PIDs.APIDs[j].is_aac && !strstr(current_PIDs.APIDs[j].desc, " (EAC3)"))
strncat(current_PIDs.APIDs[j].desc, " (EAC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1);
}
current_PIDs.APIDs[j].component_tag = -1;
break;

View File

@@ -321,7 +321,7 @@ bool CRecordInstance::Update()
audio_pids.epgAudioPid = allpids.APIDs[i].pid;
audio_pids.epgAudioPidName = allpids.APIDs[i].desc;
audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : 0;
audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0;
audio_pids.selected = 0;
recMovieInfo->audioPids.push_back(audio_pids);
}
@@ -354,11 +354,13 @@ void CRecordInstance::GetPids(CZapitChannel * channel)
CZapitClient::responseGetAPIDs response;
response.pid = channel->getAudioPid(i);
strncpy(response.desc, channel->getAudioChannel(i)->description.c_str(), DESC_MAX_LEN - 1);
response.is_ac3 = response.is_aac = 0;
response.is_ac3 = response.is_aac = response.is_eac3 = 0;
if (channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::AC3) {
response.is_ac3 = 1;
} else if (channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::AAC) {
response.is_aac = 1;
} else if (channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::EAC3) {
response.is_eac3 = 1;
}
response.component_tag = channel->getAudioChannel(i)->componentTag;
allpids.APIDs.push_back(response);
@@ -382,6 +384,8 @@ void CRecordInstance::ProcessAPIDnames()
strncat(allpids.APIDs[count].desc, " (AC3)", DESC_MAX_LEN - strlen(allpids.APIDs[count].desc) -1);
else if (allpids.APIDs[count].is_aac && !strstr(allpids.APIDs[count].desc, " (AAC)"))
strncat(allpids.APIDs[count].desc, " (AAC)", DESC_MAX_LEN - strlen(allpids.APIDs[count].desc) -1);
else if (allpids.APIDs[count].is_eac3 && !strstr(allpids.APIDs[count].desc, " (EAC3)"))
strncat(allpids.APIDs[count].desc, " (EAC3)", DESC_MAX_LEN - strlen(allpids.APIDs[count].desc) -1);
}
if(has_unresolved_ctags && (epgid != 0)) {
@@ -396,6 +400,8 @@ void CRecordInstance::ProcessAPIDnames()
strncat(allpids.APIDs[j].desc, " (AC3)", DESC_MAX_LEN - strlen(allpids.APIDs[j].desc)-1);
else if (allpids.APIDs[j].is_aac && !strstr(allpids.APIDs[j].desc, " (AAC)"))
strncat(allpids.APIDs[j].desc, " (AAC)", DESC_MAX_LEN - strlen(allpids.APIDs[j].desc)-1);
else if (allpids.APIDs[j].is_eac3 && !strstr(allpids.APIDs[j].desc, " (EAC3)"))
strncat(allpids.APIDs[j].desc, " (EAC3)", DESC_MAX_LEN - strlen(allpids.APIDs[j].desc)-1);
}
allpids.APIDs[j].component_tag = -1;
break;
@@ -455,7 +461,7 @@ void CRecordInstance::FilterPids(APIDList & apid_list)
uint32_t apid_min=UINT_MAX;
uint32_t apid_min_idx=0;
for(unsigned int i = 0; i < allpids.APIDs.size(); i++) {
if (allpids.APIDs[i].pid < apid_min && !allpids.APIDs[i].is_ac3) {
if (allpids.APIDs[i].pid < apid_min && !allpids.APIDs[i].is_ac3 && !allpids.APIDs[i].is_eac3) {
apid_min = allpids.APIDs[i].pid;
apid_min_idx = i;
}
@@ -468,12 +474,12 @@ void CRecordInstance::FilterPids(APIDList & apid_list)
if (apidmode & TIMERD_APIDS_ALT) {
uint32_t apid_min=UINT_MAX;
for(unsigned int i = 0; i < allpids.APIDs.size(); i++) {
if (allpids.APIDs[i].pid < apid_min && !allpids.APIDs[i].is_ac3) {
if (allpids.APIDs[i].pid < apid_min && !allpids.APIDs[i].is_ac3 && !allpids.APIDs[i].is_eac3) {
apid_min = allpids.APIDs[i].pid;
}
}
for(unsigned int i = 0; i < allpids.APIDs.size(); i++) {
if (allpids.APIDs[i].pid != apid_min && !allpids.APIDs[i].is_ac3) {
if (allpids.APIDs[i].pid != apid_min && !allpids.APIDs[i].is_ac3 && !allpids.APIDs[i].is_eac3) {
APIDDesc a = {allpids.APIDs[i].pid, i, false};
apid_list.push_back(a);
}
@@ -482,7 +488,7 @@ void CRecordInstance::FilterPids(APIDList & apid_list)
if (apidmode & TIMERD_APIDS_AC3) {
bool ac3_found=false;
for(unsigned int i = 0; i < allpids.APIDs.size(); i++) {
if (allpids.APIDs[i].is_ac3) {
if (allpids.APIDs[i].is_ac3 || allpids.APIDs[i].is_eac3) {
APIDDesc a = {allpids.APIDs[i].pid, i, true};
apid_list.push_back(a);
ac3_found=true;
@@ -493,7 +499,7 @@ void CRecordInstance::FilterPids(APIDList & apid_list)
uint32_t apid_min=UINT_MAX;
uint32_t apid_min_idx=0;
for(unsigned int i = 0; i < allpids.APIDs.size(); i++) {
if (allpids.APIDs[i].pid < apid_min && !allpids.APIDs[i].is_ac3) {
if (allpids.APIDs[i].pid < apid_min && !allpids.APIDs[i].is_ac3 && !allpids.APIDs[i].is_eac3) {
apid_min = allpids.APIDs[i].pid;
apid_min_idx = i;
}
@@ -509,7 +515,7 @@ void CRecordInstance::FilterPids(APIDList & apid_list)
uint32_t apid_min=UINT_MAX;
uint32_t apid_min_idx=0;
for(unsigned int i = 0; i < allpids.APIDs.size(); i++) {
if (allpids.APIDs[i].pid < apid_min && !allpids.APIDs[i].is_ac3) {
if (allpids.APIDs[i].pid < apid_min && !allpids.APIDs[i].is_ac3 && !allpids.APIDs[i].is_eac3) {
apid_min = allpids.APIDs[i].pid;
apid_min_idx = i;
}
@@ -571,7 +577,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis
if(allpids.APIDs[i].pid == it->apid) {
audio_pids.epgAudioPid = allpids.APIDs[i].pid;
audio_pids.epgAudioPidName = allpids.APIDs[i].desc;
audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : 0;
audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0;
audio_pids.selected = (audio_pids.epgAudioPid == channel->getAudioPid()) ? 1 : 0;
recMovieInfo->audioPids.push_back(audio_pids);
}
@@ -582,7 +588,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis
int i = 0;
audio_pids.epgAudioPid = allpids.APIDs[i].pid;
audio_pids.epgAudioPidName = allpids.APIDs[i].desc;
audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : 0;
audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0;
audio_pids.selected = 1;
recMovieInfo->audioPids.push_back(audio_pids);
}

View File

@@ -1623,7 +1623,7 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh)
{
strncpy( pids.APIDs[j].desc, _getISO639Description( pids.APIDs[j].desc ),DESC_MAX_LEN );
}
hh->printf("%05u %s %s\n",pids.APIDs[j].pid,pids.APIDs[j].desc,pids.APIDs[j].is_ac3 ? " (AC3)": " ");
hh->printf("%05u %s %s\n",pids.APIDs[j].pid,pids.APIDs[j].desc,pids.APIDs[j].is_ac3 ? " (AC3)": pids.APIDs[j].desc,pids.APIDs[j].is_aac ? "(AAC)" : pids.APIDs[j].desc,pids.APIDs[j].is_eac3 ? "(EAC3)" : " ");
}
eit_not_ok=false;
break;
@@ -1640,7 +1640,7 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh)
{
strncpy( pids.APIDs[i].desc, _getISO639Description( pids.APIDs[i].desc ),DESC_MAX_LEN );
}
hh->printf("%05u %s %s\n",it->pid,pids.APIDs[i].desc,pids.APIDs[i].is_ac3 ? " (AC3)": " ");
hh->printf("%05u %s %s\n",it->pid,pids.APIDs[i].desc,pids.APIDs[i].is_ac3 ? " (AC3)": pids.APIDs[i].desc,pids.APIDs[i].is_aac ? "(AAC)" : pids.APIDs[i].desc,pids.APIDs[i].is_eac3 ? "(EAC3)" : " ");
i++;
}
}

View File

@@ -600,7 +600,7 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *,
{
strcpy( pids.APIDs[j].desc, _getISO639Description( pids.APIDs[j].desc ) );
}
yresult += string_printf("<option value=%05u>%s %s</option>\r\n",idx_as_id ? j : pids.APIDs[j].pid,std::string(pids.APIDs[j].desc).c_str(),pids.APIDs[j].is_ac3 ? " (AC3)": " ");
yresult += string_printf("<option value=%05u>%s %s</option>\r\n",idx_as_id ? j : pids.APIDs[j].pid,std::string(pids.APIDs[j].desc).c_str(),pids.APIDs[j].is_ac3 ? " (AC3)": pids.APIDs[j].is_aac ? "(AAC)" : pids.APIDs[j].is_eac3 ? "(EAC3)" : " ");
}
eit_not_ok=false;
break;
@@ -617,7 +617,7 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *,
{
strcpy( pids.APIDs[i].desc, _getISO639Description( pids.APIDs[i].desc ) );
}
yresult += string_printf("<option value=%05u>%s %s</option>\r\n",idx_as_id ? i : it->pid,pids.APIDs[i].desc,pids.APIDs[i].is_ac3 ? " (AC3)": " ");
yresult += string_printf("<option value=%05u>%s %s</option>\r\n",idx_as_id ? i : it->pid,pids.APIDs[i].desc,pids.APIDs[i].is_ac3 ? " (AC3)": pids.APIDs[i].is_aac ? "(AAC)" : pids.APIDs[i].is_eac3 ? "(EAC3)" : " ");
i++;
}
}

View File

@@ -101,6 +101,7 @@ class CZapitAudioChannel
AAC,
AACPLUS, //?
DTS,
EAC3,
UNKNOWN
};
ZapitAudioChannelType audioChannelType;

View File

@@ -184,6 +184,7 @@ class CZapitClient:public CBasicClient
char desc[DESC_MAX_LEN];
int is_ac3;
int is_aac;
int is_eac3;
int component_tag;
};

View File

@@ -221,6 +221,9 @@ bool CPmt::ParseEsInfo(ElementaryStreamInfo *esinfo, CZapitChannel * const chann
case AC3_DESCRIPTOR:
audio_type = CZapitAudioChannel::AC3;
break;
case ENHANCED_AC3_DESCRIPTOR:
audio_type = CZapitAudioChannel::EAC3;
break;
case DTS_DESCRIPTOR:
audio_type = CZapitAudioChannel::DTS;
break;

View File

@@ -826,6 +826,10 @@ void CZapit::SetAudioStreamType(CZapitAudioChannel::ZapitAudioChannelType audioC
audioStr = "DTS";
audioDecoder->SetStreamType(AUDIO_FMT_DTS);
break;
case CZapitAudioChannel::EAC3:
audioStr = "DD-PLUS";
audioDecoder->SetStreamType(AUDIO_FMT_DD_PLUS);
break;
default:
printf("[zapit] unknown audio channel type 0x%x\n", audioChannelType);
break;
@@ -1842,11 +1846,13 @@ void CZapit::sendAPIDs(int connfd)
CZapitClient::responseGetAPIDs 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;
response.is_ac3 = response.is_aac = response.is_eac3 = 0;
if (current_channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::AC3) {
response.is_ac3 = 1;
} else if (current_channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::AAC) {
response.is_aac = 1;
} else if (current_channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::EAC3) {
response.is_eac3 = 1;
}
response.component_tag = current_channel->getAudioChannel(i)->componentTag;