From d2ece7b0f5c816a7a007abaddbc7db7dd184988c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 1 Feb 2021 22:05:41 +0100 Subject: [PATCH] zapit: fix cst compile Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9082ed2151c8d107e45ec89696239ddb22a96b8d Author: vanhofen Date: 2021-02-01 (Mon, 01 Feb 2021) Origin message was: ------------------ - zapit: fix cst compile ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/zapit.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 12c109d3f..1e2d637a4 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -942,6 +942,40 @@ void CZapit::SetVolumePercent(int default_ac3, int default_pcm) void CZapit::SetAudioStreamType(CZapitAudioChannel::ZapitAudioChannelType audioChannelType) { const char *audioStr = "UNKNOWN"; + +#if HAVE_CST_HARDWARE + //TODO: align libcoolstream audioDecoder->SetStreamType() + + switch (audioChannelType) { + case CZapitAudioChannel::AC3: + audioStr = "AC3"; + audioDecoder->SetStreamType(AUDIO_FMT_DOLBY_DIGITAL); + break; + case CZapitAudioChannel::MPEG: + audioStr = "MPEG2"; + audioDecoder->SetStreamType(AUDIO_FMT_MPEG); + break; + case CZapitAudioChannel::AAC: + audioStr = "AAC"; + audioDecoder->SetStreamType(AUDIO_FMT_AAC); + break; + case CZapitAudioChannel::AACPLUS: + audioStr = "AAC-HE"; + audioDecoder->SetStreamType(AUDIO_FMT_AAC_PLUS); + break; + case CZapitAudioChannel::DTS: + audioStr = "DTS"; + audioDecoder->SetStreamType(AUDIO_FMT_DTS); + break; + case CZapitAudioChannel::EAC3: + audioStr = "EAC3"; + audioDecoder->SetStreamType(AUDIO_FMT_DD_PLUS); + break; + default: + printf("[zapit] unknown audio channel type 0x%x\n", audioChannelType); + break; + } +#else switch (audioChannelType) { case CZapitAudioChannel::AC3: audioStr = "AC3"; @@ -973,6 +1007,7 @@ void CZapit::SetAudioStreamType(CZapitAudioChannel::ZapitAudioChannelType audioC } audioDecoder->SetStreamType(audioChannelType); +#endif /* FIXME: bigger percent for AC3 only, what about AAC etc ? */ int newpercent = GetPidVolume(0, 0, audioChannelType == CZapitAudioChannel::AC3 || audioChannelType == CZapitAudioChannel::EAC3);