mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 07:23:11 +02:00
armbox eplayer: use other tracklist
This commit is contained in:
@@ -126,6 +126,41 @@ static int ManagerAdd(Context_t *context, Track_t track)
|
|||||||
return cERR_AUDIO_MGR_NO_ERROR;
|
return cERR_AUDIO_MGR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char **ManagerList(Context_t * context __attribute__ ((unused)))
|
||||||
|
{
|
||||||
|
int i = 0, j = 0;
|
||||||
|
char **tracklist = NULL;
|
||||||
|
|
||||||
|
audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
||||||
|
|
||||||
|
if (Tracks != NULL) {
|
||||||
|
|
||||||
|
tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1));
|
||||||
|
|
||||||
|
if (tracklist == NULL) {
|
||||||
|
audio_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0, j = 0; i < TrackCount; i++, j += 2) {
|
||||||
|
if (Tracks[i].pending)
|
||||||
|
continue;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME,
|
||||||
|
__FUNCTION__, tracklist, j, TrackCount);
|
||||||
|
|
||||||
|
return tracklist;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static TrackDescription_t *ManagerList(Context_t *context __attribute__((unused)))
|
static TrackDescription_t *ManagerList(Context_t *context __attribute__((unused)))
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -156,6 +191,7 @@ static TrackDescription_t *ManagerList(Context_t *context __attribute__((unused
|
|||||||
//audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount);
|
//audio_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount);
|
||||||
return tracklist;
|
return tracklist;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int ManagerDel(Context_t *context)
|
static int ManagerDel(Context_t *context)
|
||||||
{
|
{
|
||||||
|
@@ -125,6 +125,41 @@ static int ManagerAdd(Context_t *context, Track_t track)
|
|||||||
return cERR_VIDEO_MGR_NO_ERROR;
|
return cERR_VIDEO_MGR_NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char **ManagerList(Context_t * context __attribute__ ((unused)))
|
||||||
|
{
|
||||||
|
int i = 0, j = 0;
|
||||||
|
char **tracklist = NULL;
|
||||||
|
|
||||||
|
video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
||||||
|
|
||||||
|
if (Tracks != NULL) {
|
||||||
|
|
||||||
|
tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1));
|
||||||
|
|
||||||
|
if (tracklist == NULL) {
|
||||||
|
video_mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0, j = 0; i < TrackCount; i++, j += 2) {
|
||||||
|
if (Tracks[i].pending)
|
||||||
|
continue;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
video_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME,
|
||||||
|
__FUNCTION__, tracklist, j, TrackCount);
|
||||||
|
|
||||||
|
return tracklist;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static char **ManagerList(Context_t *context __attribute__((unused)))
|
static char **ManagerList(Context_t *context __attribute__((unused)))
|
||||||
{
|
{
|
||||||
int i = 0, j = 0;
|
int i = 0, j = 0;
|
||||||
@@ -155,6 +190,7 @@ static char **ManagerList(Context_t *context __attribute__((unused)))
|
|||||||
video_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount);
|
video_mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, TrackCount);
|
||||||
return tracklist;
|
return tracklist;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int ManagerDel(Context_t *context)
|
static int ManagerDel(Context_t *context)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user