diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2010-12-18 21:20:53 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2010-12-18 21:20:53 +0000 |
commit | 6032ff1730513296a80989b6e430e8399d2cda89 (patch) | |
tree | bfa19f0a894f172b14128a87e6cfbdde38ac40f8 | |
parent | 8d849723f7237f1861fb1c3541f29b780e37198e (diff) | |
download | rockbox-6032ff1730513296a80989b6e430e8399d2cda89.tar.gz rockbox-6032ff1730513296a80989b6e430e8399d2cda89.zip |
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
-rw-r--r-- | apps/plugins/mpegplayer/mpegplayer.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index b324133940..f130760ff2 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c | |||
@@ -1512,14 +1512,28 @@ static void osd_seek(int btn) | |||
1512 | stream_seek(time, SEEK_SET); | 1512 | stream_seek(time, SEEK_SET); |
1513 | } | 1513 | } |
1514 | 1514 | ||
1515 | /* has this file the extension .mpg ? */ | 1515 | /* Has this file one of the supported extensions? */ |
1516 | static bool is_videofile(const char* file) | 1516 | static bool is_videofile(const char* file) |
1517 | { | 1517 | { |
1518 | static const char * const extensions[] = | ||
1519 | { | ||
1520 | /* Should match apps/plugins/viewers.config */ | ||
1521 | "mpg", "mpeg", "mpv", "m2v" | ||
1522 | }; | ||
1523 | |||
1518 | const char* ext = rb->strrchr(file, '.'); | 1524 | const char* ext = rb->strrchr(file, '.'); |
1519 | if (ext && !rb->strcasecmp(ext, ".mpg")) | 1525 | int i; |
1520 | return true; | ||
1521 | 1526 | ||
1522 | return false; | 1527 | if (!ext) |
1528 | return false; | ||
1529 | |||
1530 | for (i = ARRAYLEN(extensions) - 1; i >= 0; i--) | ||
1531 | { | ||
1532 | if (!rb->strcasecmp(ext + 1, extensions[i])) | ||
1533 | break; | ||
1534 | } | ||
1535 | |||
1536 | return i >= 0; | ||
1523 | } | 1537 | } |
1524 | 1538 | ||
1525 | /* deliver the next/previous video file in the current directory. | 1539 | /* deliver the next/previous video file in the current directory. |