mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libeplayer3: more cleanups
This commit is contained in:
@@ -41,43 +41,4 @@ static inline char *getExtension(char *name)
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the function returns the base name */
|
|
||||||
static inline char *basename(char *name)
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
int pos = 0;
|
|
||||||
|
|
||||||
while (name[i] != 0) {
|
|
||||||
if (name[i] == '/')
|
|
||||||
pos = i;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name[pos] == '/')
|
|
||||||
pos++;
|
|
||||||
|
|
||||||
return name + pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* the function returns the directry name */
|
|
||||||
static inline char *dirname(char *name)
|
|
||||||
{
|
|
||||||
static char path[100];
|
|
||||||
unsigned int i = 0;
|
|
||||||
int pos = 0;
|
|
||||||
|
|
||||||
while ((name[i] != 0) && (i < sizeof(path))) {
|
|
||||||
if (name[i] == '/')
|
|
||||||
pos = i;
|
|
||||||
path[i] = name[i];
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
path[i] = 0;
|
|
||||||
path[pos] = 0;
|
|
||||||
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -16,13 +16,11 @@ typedef struct PlaybackHandler_s {
|
|||||||
|
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
unsigned char isFile;
|
|
||||||
unsigned char isHttp;
|
unsigned char isHttp;
|
||||||
|
|
||||||
unsigned char isPlaying;
|
unsigned char isPlaying;
|
||||||
unsigned char isPaused;
|
unsigned char isPaused;
|
||||||
unsigned char isForwarding;
|
unsigned char isForwarding;
|
||||||
unsigned char isSeeking;
|
|
||||||
unsigned char isCreationPhase;
|
unsigned char isCreationPhase;
|
||||||
|
|
||||||
int BackWard;
|
int BackWard;
|
||||||
@@ -32,8 +30,6 @@ typedef struct PlaybackHandler_s {
|
|||||||
|
|
||||||
unsigned char isVideo;
|
unsigned char isVideo;
|
||||||
unsigned char isAudio;
|
unsigned char isAudio;
|
||||||
unsigned char isSubtitle;
|
|
||||||
unsigned char isDvbSubtitle;
|
|
||||||
unsigned char abortRequested;
|
unsigned char abortRequested;
|
||||||
unsigned char abortPlayback;
|
unsigned char abortPlayback;
|
||||||
|
|
||||||
|
@@ -76,7 +76,7 @@ static int CurrentTrack = -1; //no as default.
|
|||||||
/* Functions */
|
/* Functions */
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
|
|
||||||
static int ManagerAdd(Context_t * context, Track_t track)
|
static int ManagerAdd(Context_t * context __attribute__((unused)), Track_t track)
|
||||||
{
|
{
|
||||||
|
|
||||||
subtitle_mgr_printf(10, "%s::%s %s %s %d\n", FILENAME, __FUNCTION__,
|
subtitle_mgr_printf(10, "%s::%s %s %s %d\n", FILENAME, __FUNCTION__,
|
||||||
@@ -112,9 +112,6 @@ static int ManagerAdd(Context_t * context, Track_t track)
|
|||||||
return cERR_SUBTITLE_MGR_ERROR;
|
return cERR_SUBTITLE_MGR_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TrackCount > 0)
|
|
||||||
context->playback->isSubtitle = 1;
|
|
||||||
|
|
||||||
subtitle_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
subtitle_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
|
||||||
|
|
||||||
return cERR_SUBTITLE_MGR_NO_ERROR;
|
return cERR_SUBTITLE_MGR_NO_ERROR;
|
||||||
@@ -155,7 +152,7 @@ static char **ManagerList(Context_t * context __attribute__ ((unused)))
|
|||||||
return tracklist;
|
return tracklist;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ManagerDel(Context_t * context)
|
static int ManagerDel(Context_t * context __attribute__((unused)))
|
||||||
{
|
{
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -177,7 +174,6 @@ static int ManagerDel(Context_t * context)
|
|||||||
|
|
||||||
TrackCount = 0;
|
TrackCount = 0;
|
||||||
CurrentTrack = -1;
|
CurrentTrack = -1;
|
||||||
context->playback->isSubtitle = 0;
|
|
||||||
|
|
||||||
subtitle_mgr_printf(10, "%s::%s return no error\n", FILENAME,
|
subtitle_mgr_printf(10, "%s::%s return no error\n", FILENAME,
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
|
@@ -112,11 +112,9 @@ static int PlaybackOpen(Context_t * context, char *uri)
|
|||||||
|
|
||||||
context->playback->uri = strdup(uri);
|
context->playback->uri = strdup(uri);
|
||||||
|
|
||||||
context->playback->isFile = 0;
|
|
||||||
context->playback->isHttp = 0;
|
context->playback->isHttp = 0;
|
||||||
|
|
||||||
if (!strncmp("file://", uri, 7) || !strncmp("myts://", uri, 7)) {
|
if (!strncmp("file://", uri, 7) || !strncmp("myts://", uri, 7)) {
|
||||||
context->playback->isFile = 1;
|
|
||||||
if (!strncmp("myts://", uri, 7)) {
|
if (!strncmp("myts://", uri, 7)) {
|
||||||
memcpy(context->playback->uri, "file", 4);
|
memcpy(context->playback->uri, "file", 4);
|
||||||
context->playback->noprobe = 1;
|
context->playback->noprobe = 1;
|
||||||
@@ -486,7 +484,6 @@ static int PlaybackFastBackward(Context_t * context, int *speed)
|
|||||||
context->playback->BackWard = 0;
|
context->playback->BackWard = 0;
|
||||||
context->playback->Speed = 0; /* reverse end */
|
context->playback->Speed = 0; /* reverse end */
|
||||||
} else {
|
} else {
|
||||||
context->playback->isSeeking = 1;
|
|
||||||
context->playback->Speed = *speed;
|
context->playback->Speed = *speed;
|
||||||
context->playback->BackWard = 1;
|
context->playback->BackWard = 1;
|
||||||
|
|
||||||
@@ -499,7 +496,6 @@ static int PlaybackFastBackward(Context_t * context, int *speed)
|
|||||||
playback_err("OUTPUT_REVERSE failed\n");
|
playback_err("OUTPUT_REVERSE failed\n");
|
||||||
context->playback->BackWard = 0;
|
context->playback->BackWard = 0;
|
||||||
context->playback->Speed = 1;
|
context->playback->Speed = 1;
|
||||||
context->playback->isSeeking = 0;
|
|
||||||
ret = cERR_PLAYBACK_ERROR;
|
ret = cERR_PLAYBACK_ERROR;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -509,7 +505,6 @@ static int PlaybackFastBackward(Context_t * context, int *speed)
|
|||||||
|
|
||||||
if (context->playback->BackWard)
|
if (context->playback->BackWard)
|
||||||
context->output->Command(context, OUTPUT_AUDIOMUTE, "1");
|
context->output->Command(context, OUTPUT_AUDIOMUTE, "1");
|
||||||
context->playback->isSeeking = 0;
|
|
||||||
playback_printf(10, "exiting with value %d\n", ret);
|
playback_printf(10, "exiting with value %d\n", ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -559,8 +554,6 @@ static int PlaybackSeek(Context_t * context, float *pos, int absolute)
|
|||||||
|
|
||||||
playback_printf(10, "pos: %f\n", *pos);
|
playback_printf(10, "pos: %f\n", *pos);
|
||||||
|
|
||||||
context->playback->isSeeking = 1;
|
|
||||||
|
|
||||||
context->output->Command(context, OUTPUT_CLEAR, NULL);
|
context->output->Command(context, OUTPUT_CLEAR, NULL);
|
||||||
|
|
||||||
if (absolute)
|
if (absolute)
|
||||||
@@ -568,8 +561,6 @@ static int PlaybackSeek(Context_t * context, float *pos, int absolute)
|
|||||||
else
|
else
|
||||||
context->container->selectedContainer->Command(context, CONTAINER_SEEK, pos);
|
context->container->selectedContainer->Command(context, CONTAINER_SEEK, pos);
|
||||||
|
|
||||||
context->playback->isSeeking = 0;
|
|
||||||
|
|
||||||
playback_printf(10, "exiting with value %d\n", ret);
|
playback_printf(10, "exiting with value %d\n", ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -866,10 +857,6 @@ PlaybackHandler_t PlaybackHandler = {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
&Command,
|
&Command,
|
||||||
"",
|
"",
|
||||||
0,
|
0,
|
||||||
|
Reference in New Issue
Block a user