mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
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);
|
||||
}
|
||||
|
||||
/* has this file the extension .mpg ? */
|
||||
/* Has this file one of the supported extensions? */
|
||||
static bool is_videofile(const char* file)
|
||||
{
|
||||
const char* ext = rb->strrchr(file, '.');
|
||||
if (ext && !rb->strcasecmp(ext, ".mpg"))
|
||||
return true;
|
||||
static const char * const extensions[] =
|
||||
{
|
||||
/* 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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue