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:
Michael Sevakis 2010-12-18 21:20:53 +00:00
parent 8d849723f7
commit 6032ff1730

View file

@ -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.