forked from len0rd/rockbox
MPEGPlayer playlist should as well support all viewer-handled file extensions...indeed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28850 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8d849723f7
commit
6032ff1730
1 changed files with 19 additions and 5 deletions
|
|
@ -1512,14 +1512,28 @@ static void osd_seek(int btn)
|
||||||
stream_seek(time, SEEK_SET);
|
stream_seek(time, SEEK_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* has this file the extension .mpg ? */
|
/* Has this file one of the supported extensions? */
|
||||||
static bool is_videofile(const char* file)
|
static bool is_videofile(const char* file)
|
||||||
{
|
{
|
||||||
const char* ext = rb->strrchr(file, '.');
|
static const char * const extensions[] =
|
||||||
if (ext && !rb->strcasecmp(ext, ".mpg"))
|
{
|
||||||
return true;
|
/* Should match apps/plugins/viewers.config */
|
||||||
|
"mpg", "mpeg", "mpv", "m2v"
|
||||||
|
};
|
||||||
|
|
||||||
return false;
|
const char* ext = rb->strrchr(file, '.');
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!ext)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (i = ARRAYLEN(extensions) - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
if (!rb->strcasecmp(ext + 1, extensions[i]))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return i >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* deliver the next/previous video file in the current directory.
|
/* deliver the next/previous video file in the current directory.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue