mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
FIX AC3 audio for CST. Including audio AC3 switching by audio language menu
This commit is contained in:
@@ -131,6 +131,8 @@ audio.srs_nmgr Noise-Manager
|
|||||||
audio.srs_volume Referenzlautstärke
|
audio.srs_volume Referenzlautstärke
|
||||||
audiomenu.PCMOffset Lautstärkeabsenkung PCM
|
audiomenu.PCMOffset Lautstärkeabsenkung PCM
|
||||||
audiomenu.ac3 AC3 durchleiten
|
audiomenu.ac3 AC3 durchleiten
|
||||||
|
audiomenu.ac3_atype0 AC3 Ton auf älteren Typ ändern
|
||||||
|
audiomenu.ac3_atype1 AC3 Ton auf default Type ändern
|
||||||
audiomenu.analog_mode Analog Modus
|
audiomenu.analog_mode Analog Modus
|
||||||
audiomenu.analog_out Analog-Ausgang
|
audiomenu.analog_out Analog-Ausgang
|
||||||
audiomenu.auto_lang Tonwahl automatisch
|
audiomenu.auto_lang Tonwahl automatisch
|
||||||
|
@@ -131,6 +131,8 @@ audio.srs_nmgr Noise manager
|
|||||||
audio.srs_volume Reference volume
|
audio.srs_volume Reference volume
|
||||||
audiomenu.PCMOffset Volume Decrease PCM
|
audiomenu.PCMOffset Volume Decrease PCM
|
||||||
audiomenu.ac3 AC3 passthrough
|
audiomenu.ac3 AC3 passthrough
|
||||||
|
audiomenu.ac3_atype0 switch AC3 Sound to older Audio Type
|
||||||
|
audiomenu.ac3_atype1 switch AC3 Sound to default Audio Type
|
||||||
audiomenu.analog_mode Analog mode
|
audiomenu.analog_mode Analog mode
|
||||||
audiomenu.analog_out Analog output
|
audiomenu.analog_out Analog output
|
||||||
audiomenu.auto_lang Auto select audio
|
audiomenu.auto_lang Auto select audio
|
||||||
|
@@ -23,15 +23,15 @@ typedef enum {
|
|||||||
} AUDIO_SYNC_MODE;
|
} AUDIO_SYNC_MODE;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
AUDIO_FMT_AUTO = 0,
|
AUDIO_FMT_DOLBY_DIGITAL = 0,
|
||||||
AUDIO_FMT_MPEG,
|
|
||||||
AUDIO_FMT_MP3,
|
|
||||||
AUDIO_FMT_DOLBY_DIGITAL,
|
|
||||||
AUDIO_FMT_BASIC = AUDIO_FMT_DOLBY_DIGITAL,
|
AUDIO_FMT_BASIC = AUDIO_FMT_DOLBY_DIGITAL,
|
||||||
AUDIO_FMT_AAC,
|
AUDIO_FMT_MPEG = 1,
|
||||||
AUDIO_FMT_AAC_PLUS,
|
AUDIO_FMT_DTS = 2,
|
||||||
AUDIO_FMT_DD_PLUS,
|
AUDIO_FMT_AAC = 8,
|
||||||
AUDIO_FMT_DTS,
|
AUDIO_FMT_AAC_PLUS = 9,
|
||||||
|
AUDIO_FMT_DD_PLUS = 0x22, //EAC3
|
||||||
|
AUDIO_FMT_AUTO,
|
||||||
|
AUDIO_FMT_MP3,
|
||||||
AUDIO_FMT_AVS,
|
AUDIO_FMT_AVS,
|
||||||
AUDIO_FMT_MLP,
|
AUDIO_FMT_MLP,
|
||||||
AUDIO_FMT_WMA,
|
AUDIO_FMT_WMA,
|
||||||
|
@@ -23,15 +23,15 @@ typedef enum {
|
|||||||
} AUDIO_SYNC_MODE;
|
} AUDIO_SYNC_MODE;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
AUDIO_FMT_AUTO = 0,
|
AUDIO_FMT_DOLBY_DIGITAL = 0,
|
||||||
AUDIO_FMT_MPEG,
|
|
||||||
AUDIO_FMT_MP3,
|
|
||||||
AUDIO_FMT_DOLBY_DIGITAL,
|
|
||||||
AUDIO_FMT_BASIC = AUDIO_FMT_DOLBY_DIGITAL,
|
AUDIO_FMT_BASIC = AUDIO_FMT_DOLBY_DIGITAL,
|
||||||
AUDIO_FMT_AAC,
|
AUDIO_FMT_MPEG = 1,
|
||||||
AUDIO_FMT_AAC_PLUS,
|
AUDIO_FMT_DTS = 2,
|
||||||
AUDIO_FMT_DD_PLUS,
|
AUDIO_FMT_AAC = 8,
|
||||||
AUDIO_FMT_DTS,
|
AUDIO_FMT_AAC_PLUS = 9,
|
||||||
|
AUDIO_FMT_DD_PLUS = 0x22, //EAC3
|
||||||
|
AUDIO_FMT_AUTO,
|
||||||
|
AUDIO_FMT_MP3,
|
||||||
AUDIO_FMT_AVS,
|
AUDIO_FMT_AVS,
|
||||||
AUDIO_FMT_MLP,
|
AUDIO_FMT_MLP,
|
||||||
AUDIO_FMT_WMA,
|
AUDIO_FMT_WMA,
|
||||||
|
@@ -1473,7 +1473,7 @@ bool CMoviePlayerGui::PlayFileStart(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
duration = p_movie_info->length * 60 * 1000;
|
duration = p_movie_info->length * 60 * 1000;
|
||||||
int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->channelId, currentapid, currentac3 == 1);
|
int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->channelId, currentapid, currentac3 == CZapitAudioChannel::AC3);
|
||||||
CZapit::getInstance()->SetVolumePercent(percent);
|
CZapit::getInstance()->SetVolumePercent(percent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2484,7 +2484,9 @@ void CMoviePlayerGui::selectAudioPid()
|
|||||||
if (numpida)
|
if (numpida)
|
||||||
currentapid = apids[0];
|
currentapid = apids[0];
|
||||||
}
|
}
|
||||||
for (unsigned int count = 0; count < numpida; count++) {
|
|
||||||
|
unsigned int count = 0;
|
||||||
|
for (count = 0; count < numpida; count++) {
|
||||||
bool name_ok = false;
|
bool name_ok = false;
|
||||||
bool enabled = true;
|
bool enabled = true;
|
||||||
bool defpid = currentapid ? (currentapid == apids[count]) : (count == 0);
|
bool defpid = currentapid ? (currentapid == apids[count]) : (count == 0);
|
||||||
@@ -2513,7 +2515,13 @@ void CMoviePlayerGui::selectAudioPid()
|
|||||||
CMenuForwarder * item = new CMenuForwarder(apidtitle.c_str(), enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(count + 1));
|
CMenuForwarder * item = new CMenuForwarder(apidtitle.c_str(), enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(count + 1));
|
||||||
APIDSelector.addItem(item, defpid);
|
APIDSelector.addItem(item, defpid);
|
||||||
}
|
}
|
||||||
|
#if HAVE_CST_HARDWARE
|
||||||
|
char cnt[5];
|
||||||
|
sprintf(cnt, "%d", count);
|
||||||
|
std::string apidtitle = (currentac3 == 0) ? g_Locale->getText(LOCALE_AUDIOMENU_AC3_ATYPE1) : g_Locale->getText(LOCALE_AUDIOMENU_AC3_ATYPE0);
|
||||||
|
CMenuForwarder * item = new CMenuForwarder(apidtitle.c_str(), true, NULL, selector, cnt, CRCInput::convertDigitToKey(count + 1));
|
||||||
|
APIDSelector.addItem(item, false);
|
||||||
|
#endif
|
||||||
int percent[numpida+1];
|
int percent[numpida+1];
|
||||||
if (p_movie_info && numpida <= p_movie_info->audioPids.size()) {
|
if (p_movie_info && numpida <= p_movie_info->audioPids.size()) {
|
||||||
APIDSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST));
|
APIDSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST));
|
||||||
@@ -2537,6 +2545,20 @@ void CMoviePlayerGui::selectAudioPid()
|
|||||||
APIDSelector.exec(NULL, "");
|
APIDSelector.exec(NULL, "");
|
||||||
delete selector;
|
delete selector;
|
||||||
printf("CMoviePlayerGui::selectAudioPid: selected %d (%x) current %x\n", select, (select >= 0) ? apids[select] : -1, currentapid);
|
printf("CMoviePlayerGui::selectAudioPid: selected %d (%x) current %x\n", select, (select >= 0) ? apids[select] : -1, currentapid);
|
||||||
|
#if HAVE_CST_HARDWARE
|
||||||
|
if (select == numpida) {
|
||||||
|
currentac3 == 1 ? currentac3 = 0 : currentac3 = 1;
|
||||||
|
playback->SetAPid(currentapid, currentac3);
|
||||||
|
printf("[movieplayer] currentac3 changed to %d\n", currentac3);
|
||||||
|
}
|
||||||
|
else if ((select >= 0) && (currentapid != apids[select])) {
|
||||||
|
currentapid = apids[select];
|
||||||
|
currentac3 = ac3flags[select];
|
||||||
|
playback->SetAPid(currentapid, currentac3);
|
||||||
|
getCurrentAudioName(is_file_player, currentaudioname);
|
||||||
|
printf("[movieplayer] apid changed to %d type %d\n", currentapid, currentac3);
|
||||||
|
}
|
||||||
|
#else
|
||||||
if ((select >= 0) && (currentapid != apids[select])) {
|
if ((select >= 0) && (currentapid != apids[select])) {
|
||||||
currentapid = apids[select];
|
currentapid = apids[select];
|
||||||
currentac3 = ac3flags[select];
|
currentac3 = ac3flags[select];
|
||||||
@@ -2544,6 +2566,7 @@ void CMoviePlayerGui::selectAudioPid()
|
|||||||
getCurrentAudioName(is_file_player, currentaudioname);
|
getCurrentAudioName(is_file_player, currentaudioname);
|
||||||
printf("[movieplayer] apid changed to %d type %d\n", currentapid, currentac3);
|
printf("[movieplayer] apid changed to %d type %d\n", currentapid, currentac3);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/)
|
void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/)
|
||||||
|
@@ -158,6 +158,8 @@ typedef enum
|
|||||||
LOCALE_AUDIO_SRS_VOLUME,
|
LOCALE_AUDIO_SRS_VOLUME,
|
||||||
LOCALE_AUDIOMENU_PCMOFFSET,
|
LOCALE_AUDIOMENU_PCMOFFSET,
|
||||||
LOCALE_AUDIOMENU_AC3,
|
LOCALE_AUDIOMENU_AC3,
|
||||||
|
LOCALE_AUDIOMENU_AC3_ATYPE0,
|
||||||
|
LOCALE_AUDIOMENU_AC3_ATYPE1,
|
||||||
LOCALE_AUDIOMENU_ANALOG_MODE,
|
LOCALE_AUDIOMENU_ANALOG_MODE,
|
||||||
LOCALE_AUDIOMENU_ANALOG_OUT,
|
LOCALE_AUDIOMENU_ANALOG_OUT,
|
||||||
LOCALE_AUDIOMENU_AUTO_LANG,
|
LOCALE_AUDIOMENU_AUTO_LANG,
|
||||||
|
@@ -158,6 +158,8 @@ const char * locale_real_names[] =
|
|||||||
"audio.srs_volume",
|
"audio.srs_volume",
|
||||||
"audiomenu.PCMOffset",
|
"audiomenu.PCMOffset",
|
||||||
"audiomenu.ac3",
|
"audiomenu.ac3",
|
||||||
|
"audiomenu.ac3_atype0",
|
||||||
|
"audiomenu.ac3_atype1",
|
||||||
"audiomenu.analog_mode",
|
"audiomenu.analog_mode",
|
||||||
"audiomenu.analog_out",
|
"audiomenu.analog_out",
|
||||||
"audiomenu.auto_lang",
|
"audiomenu.auto_lang",
|
||||||
|
@@ -99,19 +99,6 @@ class CZapitAudioChannel
|
|||||||
std::string description;
|
std::string description;
|
||||||
unsigned char componentTag;
|
unsigned char componentTag;
|
||||||
|
|
||||||
#if HAVE_CST_HARDWARE
|
|
||||||
enum ZapitAudioChannelType {
|
|
||||||
MPEG = 0,
|
|
||||||
AC3 = 1,
|
|
||||||
AAC = 2,
|
|
||||||
AACPLUS = 3,
|
|
||||||
DTS = 4,
|
|
||||||
LPCM = 6,
|
|
||||||
DTSHD = 0x10,
|
|
||||||
EAC3 = 0x22,
|
|
||||||
UNKNOWN
|
|
||||||
};
|
|
||||||
#else
|
|
||||||
enum ZapitAudioChannelType {
|
enum ZapitAudioChannelType {
|
||||||
MPEG = 1,
|
MPEG = 1,
|
||||||
AC3 = 0,
|
AC3 = 0,
|
||||||
@@ -123,7 +110,6 @@ class CZapitAudioChannel
|
|||||||
EAC3 = 0x22,
|
EAC3 = 0x22,
|
||||||
UNKNOWN
|
UNKNOWN
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
ZapitAudioChannelType audioChannelType;
|
ZapitAudioChannelType audioChannelType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user