- playback_libeplayer3: nicening apid decription; party stolen from TangoCash

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-09-18 20:36:19 +02:00
committed by Thilo Graf
parent 1c4cbaca9c
commit 68c341c7d9

View File

@@ -563,12 +563,9 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]); printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
if (j < max_numpida) if (j < max_numpida)
{ {
int _pid = 0; int _pid;
std::string _lang ; char _lang[strlen(TrackList[i])];
std::istringstream iss(TrackList[i]) ; if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang))
iss >> _pid;
iss >> _lang;
if (_pid && !_lang.empty())
{ {
apids[j] = _pid; apids[j] = _pid;
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC // atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
@@ -593,11 +590,13 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
else else
ac3flags[j] = 0; //todo ac3flags[j] = 0; //todo
std::string _language = ""; std::string _language = "";
_language += _lang; _language += std::string(_lang);
_language += " - "; if (_language.compare("und") == 0)
_language += "("; _language = "Stream " + std::to_string((int)i);
_language += TrackList[i + 1]; //_language += " - ";
_language += ")"; //_language += "(";
//_language += TrackList[i + 1];
//_language += ")";
language[j] = _language; language[j] = _language;
} }
} }
@@ -630,15 +629,12 @@ void cPlayback::FindAllSubtitlePids(int *pids, unsigned int *numpids, std::strin
printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]); printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]);
if (j < max_numpids) if (j < max_numpids)
{ {
int _pid = 0; int _pid;
std::string _lang ; char _lang[strlen(TrackList[i])];
std::istringstream iss(TrackList[i]) ; if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang))
iss >> _pid;
iss >> _lang;
if (_pid && !_lang.empty())
{ {
pids[j] = _pid; pids[j] = _pid;
language[j] = _lang; language[j] = std::string(_lang);
} }
} }
free(TrackList[i]); free(TrackList[i]);