summaryrefslogtreecommitdiff
path: root/apps/playlist.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2005-01-20 16:24:26 +0000
committerBjörn Stenberg <bjorn@haxx.se>2005-01-20 16:24:26 +0000
commit30d8f6192ff8217afb7d9bf0722dfd2c66a4d599 (patch)
tree8ec22be7b19a98d74ac7d6ea3f77db106d6b46dd /apps/playlist.c
parentbe7452d31eee7d2cc78c371d0dca885167922e44 (diff)
downloadrockbox-30d8f6192ff8217afb7d9bf0722dfd2c66a4d599.tar.gz
rockbox-30d8f6192ff8217afb7d9bf0722dfd2c66a4d599.zip
Added music playing from ID3 browser.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5616 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist.c')
-rw-r--r--apps/playlist.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 651a5afeea..924b9041e8 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -244,7 +244,8 @@ static void new_playlist(struct playlist_info* playlist, const char *dir,
244 */ 244 */
245static void create_control(struct playlist_info* playlist) 245static void create_control(struct playlist_info* playlist)
246{ 246{
247 playlist->control_fd = creat(playlist->control_filename, 0000200); 247 playlist->control_fd = open(playlist->control_filename,
248 O_CREAT|O_RDWR|O_TRUNC);
248 if (playlist->control_fd < 0) 249 if (playlist->control_fd < 0)
249 { 250 {
250 if (check_rockboxdir()) 251 if (check_rockboxdir())
@@ -950,18 +951,19 @@ static int get_filename(struct playlist_info* playlist, int seek,
950 if (control_file) 951 if (control_file)
951 mutex_lock(&playlist->control_mutex); 952 mutex_lock(&playlist->control_mutex);
952 953
953 lseek(fd, seek, SEEK_SET); 954 if (lseek(fd, seek, SEEK_SET) != seek)
954 max = read(fd, tmp_buf, buf_length); 955 max = -1;
956 else
957 max = read(fd, tmp_buf, buf_length);
955 958
956 if (control_file) 959 if (control_file)
957 mutex_unlock(&playlist->control_mutex); 960 mutex_unlock(&playlist->control_mutex);
958 } 961 }
959 962
960 if (max < 0) 963 if (max < 0)
961 { 964 {
962 if (control_file) 965 if (control_file)
963 splash(HZ*2, true, 966 splash(HZ*2, true, str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
964 str(LANG_PLAYLIST_CONTROL_ACCESS_ERROR));
965 else 967 else
966 splash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR)); 968 splash(HZ*2, true, str(LANG_PLAYLIST_ACCESS_ERROR));
967 969