mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 15:32:43 +02:00
libeplayer3: use actual pids instead of indexes
Origin commit data
------------------
Branch: master
Commit: fb16fc2ffb
Author: martii <m4rtii@gmx.de>
Date: 2013-07-12 (Fri, 12 Jul 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -124,7 +124,10 @@ static char ** ManagerList(Context_t *context __attribute__((unused))) {
|
||||
}
|
||||
|
||||
for (i = 0, j = 0; i < TrackCount; i++, j+=2) {
|
||||
tracklist[j] = strdup(Tracks[i].Name);
|
||||
size_t len = strlen(Tracks[i].Name) + 20;
|
||||
char tmp[len];
|
||||
snprintf(tmp, len, "%d %s\n", Tracks[i].Id, Tracks[i].Name);
|
||||
tracklist[j] = strdup(tmp);
|
||||
tracklist[j+1] = strdup(Tracks[i].Encoding);
|
||||
}
|
||||
tracklist[j] = NULL;
|
||||
@@ -214,23 +217,17 @@ static int Command(void *_context, ManagerCmd_t command, void * argument) {
|
||||
break;
|
||||
}
|
||||
case MANAGER_SET: {
|
||||
int id = *((int*)argument);
|
||||
int i;
|
||||
dvbsubtitle_mgr_printf(20, "%s::%s MANAGER_SET id=%d\n", FILENAME, __FUNCTION__, *((int*)argument));
|
||||
|
||||
dvbsubtitle_mgr_printf(20, "%s::%s MANAGER_SET id=%d\n", FILENAME, __FUNCTION__, id);
|
||||
|
||||
if (id >= TrackCount) {
|
||||
int mypid = id;
|
||||
for (id = 0; id < TrackCount; id++) {
|
||||
if (((AVStream *) (Tracks[id].stream))->id == mypid)
|
||||
break;
|
||||
for (i = 0; i < TrackCount; i++)
|
||||
if (Tracks[i].Id == *((int*)argument)) {
|
||||
CurrentTrack = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (id < TrackCount)
|
||||
CurrentTrack = id;
|
||||
else
|
||||
{
|
||||
dvbsubtitle_mgr_err("%s::%s track id out of range (%d - %d)\n", FILENAME, __FUNCTION__, id, TrackCount);
|
||||
if (i == TrackCount) {
|
||||
dvbsubtitle_mgr_err("%s::%s track id %d unknown\n", FILENAME, __FUNCTION__, *((int*)argument));
|
||||
ret = cERR_DVBSUBTITLE_MGR_ERROR;
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user