diff options
| author | Magnus Holmgren <magnushol@gmail.com> | 2006-09-10 10:59:51 +0000 |
|---|---|---|
| committer | Magnus Holmgren <magnushol@gmail.com> | 2006-09-10 10:59:51 +0000 |
| commit | e605786b2a737246e5813b5af1a910a0797f36de (patch) | |
| tree | cfa8eccbf265e617d89a07c48f2d41f4db34f38a | |
| parent | a4858cfa1c0f3c271ebc301b75769fdac74d3a20 (diff) | |
| download | rockbox-e605786b2a737246e5813b5af1a910a0797f36de.zip rockbox-e605786b2a737246e5813b5af1a910a0797f36de.tar.gz rockbox-e605786b2a737246e5813b5af1a910a0797f36de.tar.bz2 rockbox-e605786b2a737246e5813b5af1a910a0797f36de.tar.xz | |
Patch #5770 by Dominik Riebeling: Skip BOM in playlists. Add '.m3u8' as a supported playlist extension.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10917 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/playlist.c | 8 | ||||
| -rw-r--r-- | apps/tree.c | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index aa84bb0..2f0895a 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -501,6 +501,14 @@ static int add_indices_to_playlist(struct playlist_info* playlist, p = (unsigned char *)buffer; + /* utf8 BOM at beginning of file? */ + if(i == 0 && nread > 3 + && *p == 0xef && *(p+1) == 0xbb && *(p+2) == 0xbf) { + nread -= 3; + p += 3; + i += 3; + } + for(count=0; count < nread; count++,p++) { /* Are we on a new line? */ diff --git a/apps/tree.c b/apps/tree.c index 82a7a3b..50ad922 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -106,6 +106,7 @@ const struct filetype filetypes[] = { { "sid", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA }, #endif { "m3u", TREE_ATTR_M3U, Icon_Playlist, LANG_PLAYLIST }, + { "m3u8", TREE_ATTR_M3U, Icon_Playlist, LANG_PLAYLIST }, { "cfg", TREE_ATTR_CFG, Icon_Config, VOICE_EXT_CFG }, { "wps", TREE_ATTR_WPS, Icon_Wps, VOICE_EXT_WPS }, #ifdef HAVE_REMOTE_LCD |