mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 00:41:09 +02:00
gui/movieplayer.cpp: try to select file play audio lang from audio preferences
Origin commit data
------------------
Commit: 64688db9c4
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-02-18 (Tue, 18 Feb 2014)
This commit is contained in:
@@ -585,15 +585,8 @@ void CMoviePlayerGui::PlayFile(void)
|
|||||||
playback->SetSpeed(1);
|
playback->SetSpeed(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_file_player && ext_subs) {
|
if (is_file_player)
|
||||||
playback->FindAllSubs(spids, sub_supported, &numsubs, slanguage);
|
selectAutoLang();
|
||||||
for (unsigned count = 0; count < numsubs; count++) {
|
|
||||||
if (spids[count] == 0x1FFF) {
|
|
||||||
currentspid = spids[count];
|
|
||||||
playback->SelectSubtitles(currentspid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CAudioMute::getInstance()->enableMuteIcon(true);
|
CAudioMute::getInstance()->enableMuteIcon(true);
|
||||||
InfoClock->enableInfoClock(true);
|
InfoClock->enableInfoClock(true);
|
||||||
@@ -1557,3 +1550,41 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data)
|
|||||||
avsubtitle_free(sub);
|
avsubtitle_free(sub);
|
||||||
delete sub;
|
delete sub;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMoviePlayerGui::selectAutoLang()
|
||||||
|
{
|
||||||
|
if (ext_subs) {
|
||||||
|
playback->FindAllSubs(spids, sub_supported, &numsubs, slanguage);
|
||||||
|
for (unsigned count = 0; count < numsubs; count++) {
|
||||||
|
if (spids[count] == 0x1FFF) {
|
||||||
|
currentspid = spids[count];
|
||||||
|
playback->SelectSubtitles(currentspid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(g_settings.auto_lang) {
|
||||||
|
int pref_idx = -1;
|
||||||
|
|
||||||
|
playback->FindAllPids(apids, ac3flags, &numpida, language);
|
||||||
|
for(int i = 0; i < 3; i++) {
|
||||||
|
for (unsigned j = 0; j < numpida; j++) {
|
||||||
|
std::map<std::string, std::string>::const_iterator it;
|
||||||
|
for(it = iso639.begin(); it != iso639.end(); ++it) {
|
||||||
|
if (g_settings.pref_lang[i] == it->second && strncasecmp(language[j].c_str(), it->first.c_str(), 3) == 0) {
|
||||||
|
pref_idx = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pref_idx >= 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (pref_idx >= 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (pref_idx >= 0) {
|
||||||
|
currentapid = apids[pref_idx];
|
||||||
|
currentac3 = ac3flags[pref_idx];
|
||||||
|
playback->SetAPid(currentapid, currentac3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -141,6 +141,7 @@ class CMoviePlayerGui : public CMenuTarget
|
|||||||
void showSubtitle(neutrino_msg_data_t data);
|
void showSubtitle(neutrino_msg_data_t data);
|
||||||
void clearSubtitle();
|
void clearSubtitle();
|
||||||
void selectChapter();
|
void selectChapter();
|
||||||
|
void selectAutoLang();
|
||||||
|
|
||||||
void Cleanup();
|
void Cleanup();
|
||||||
static void *ShowStartHint(void *arg);
|
static void *ShowStartHint(void *arg);
|
||||||
|
Reference in New Issue
Block a user