Skip to content

Commit

Permalink
Merge pull request OpenPLi#3720 from Dima73/pull
Browse files Browse the repository at this point in the history
  • Loading branch information
littlesat authored May 29, 2023
2 parents 1857345 + a4dabe0 commit 1b5494b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/dvb/pmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
{
unsigned int i;
int first_non_mpeg = -1;
int first_mpeg = -1;
int audio_cached = -1;
int autoaudio_mpeg = -1;
int autoaudio_ac3 = -1;
Expand Down Expand Up @@ -502,6 +503,12 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
{
first_non_mpeg = i;
}

if (autoaudio_languages.empty() && program.audioStreams[i].type == audioStream::atMPEG && first_mpeg == -1)
{
first_mpeg = i;
}

if (!program.audioStreams[i].language_code.empty())
{
int x = 1;
Expand Down Expand Up @@ -599,6 +606,8 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
program.defaultAudioStream = autoaudio_aac;
else if (first_non_mpeg != -1 && (defaultac3 || defaultddp))
program.defaultAudioStream = first_non_mpeg;
else if (first_non_mpeg != -1 && first_mpeg != -1 && first_non_mpeg < first_mpeg && (!defaultac3 || !defaultddp))
program.defaultAudioStream = first_mpeg;
}

bool allow_hearingimpaired = eConfigManager::getConfigBoolValue("config.autolanguage.subtitle_hearingimpaired");
Expand Down

0 comments on commit 1b5494b

Please sign in to comment.