mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libeplayer3: cleanup
This commit is contained in:
@@ -37,48 +37,14 @@ void FlushBits(BitPacker_t * ld);
|
||||
/* MISC Functions */
|
||||
/* ***************************** */
|
||||
|
||||
static inline void getExtension(char * FILENAMEname, char ** extension) {
|
||||
|
||||
int i = 0;
|
||||
int stringlength;
|
||||
|
||||
if (extension == NULL)
|
||||
return;
|
||||
|
||||
*extension = NULL;
|
||||
|
||||
if (FILENAMEname == NULL)
|
||||
return;
|
||||
|
||||
stringlength = (int) strlen(FILENAMEname);
|
||||
|
||||
for (i = 0; stringlength - i > 0; i++) {
|
||||
if (FILENAMEname[stringlength - i - 1] == '.') {
|
||||
*extension = strdup(FILENAMEname+(stringlength - i));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void getUPNPExtension(char * FILENAMEname, char ** extension) {
|
||||
char* str;
|
||||
|
||||
if (extension == NULL)
|
||||
return;
|
||||
|
||||
*extension = NULL;
|
||||
|
||||
if (FILENAMEname == NULL)
|
||||
return;
|
||||
|
||||
str = strstr(FILENAMEname, "ext=");
|
||||
|
||||
if (str != NULL)
|
||||
{
|
||||
*extension = strdup(str + strlen("ext=") + 1);
|
||||
return;
|
||||
}
|
||||
*extension = NULL;
|
||||
static inline char *getExtension(char * name)
|
||||
{
|
||||
if (name) {
|
||||
char *ext = strrchr(name, '.');
|
||||
if (ext)
|
||||
return ext + 1;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* the function returns the base name */
|
||||
|
Reference in New Issue
Block a user