diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playlist.c | 38 |
1 files changed, 5 insertions, 33 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 12749dba67..5e22c86d8c 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -58,8 +58,7 @@ char* playlist_next(int type) | |||
58 | (now_playing[seek] != '\r') && | 58 | (now_playing[seek] != '\r') && |
59 | (seek < max)) | 59 | (seek < max)) |
60 | seek++; | 60 | seek++; |
61 | /* if(seek == max) | 61 | |
62 | seek = max-1;*/ | ||
63 | now_playing[seek]=0; | 62 | now_playing[seek]=0; |
64 | 63 | ||
65 | return now_playing; | 64 | return now_playing; |
@@ -100,47 +99,20 @@ void empty_playlist( playlist_info_t *playlist ) | |||
100 | */ | 99 | */ |
101 | void add_indices_to_playlist( playlist_info_t *playlist ) | 100 | void add_indices_to_playlist( playlist_info_t *playlist ) |
102 | { | 101 | { |
103 | /* | ||
104 | char *p; | ||
105 | int i = 0; | ||
106 | unsigned char byte; | ||
107 | unsigned char lastbyte='\n'; | ||
108 | */ | ||
109 | int nread; | 102 | int nread; |
110 | |||
111 | int fd; | 103 | int fd; |
112 | |||
113 | int i = 0; | 104 | int i = 0; |
114 | unsigned char *p; | ||
115 | unsigned char buf[255]; | ||
116 | int store_index = 0; | 105 | int store_index = 0; |
117 | int count = 0; | 106 | int count = 0; |
118 | 107 | ||
108 | unsigned char *p; | ||
109 | unsigned char buf[255]; | ||
110 | |||
111 | |||
119 | fd = open(playlist->filename, O_RDONLY); | 112 | fd = open(playlist->filename, O_RDONLY); |
120 | if(-1 == fd) | 113 | if(-1 == fd) |
121 | return; /* failure */ | 114 | return; /* failure */ |
122 | 115 | ||
123 | #ifdef ROBHAK | ||
124 | p = &byte; /* Not being used? */ | ||
125 | |||
126 | /* loop thru buffer, store index whenever we get a new line */ | ||
127 | |||
128 | while((nread = read(fd, &byte, 1)) == 1) | ||
129 | { | ||
130 | /* move thru (any) newlines */ | ||
131 | |||
132 | if(( byte != '\n' ) && ( byte != '\r' ) && | ||
133 | ((lastbyte == '\n') || (lastbyte == '\r'))) { | ||
134 | /* we're now at the start of a new track filename. store index */ | ||
135 | |||
136 | DEBUGF("tune %d at position %d\n", playlist->amount, i); | ||
137 | playlist->indices [ playlist->amount ] = i; | ||
138 | playlist->amount++; | ||
139 | } | ||
140 | i++; | ||
141 | lastbyte = byte; | ||
142 | } | ||
143 | #endif | ||
144 | store_index = 1; | 116 | store_index = 1; |
145 | 117 | ||
146 | while((nread = read(fd, &buf, sizeof(buf))) != 0) | 118 | while((nread = read(fd, &buf, sizeof(buf))) != 0) |