|
Lines 106-111
Error PLS::ReadPlaylist(const char* url,
Link Here
|
| 106 |
char key[_MAX_PATH]; |
106 |
char key[_MAX_PATH]; |
| 107 |
char value[_MAX_PATH]; |
107 |
char value[_MAX_PATH]; |
| 108 |
// char root[_MAX_PATH]; |
108 |
// char root[_MAX_PATH]; |
|
|
109 |
char format[32]; |
| 109 |
|
110 |
|
| 110 |
string path,file,root,title; //file,title,key,value,root; |
111 |
string path,file,root,title; //file,title,key,value,root; |
| 111 |
|
112 |
|
|
Lines 132-137
Error PLS::ReadPlaylist(const char* url,
Link Here
|
| 132 |
if(IsError(result)) |
133 |
if(IsError(result)) |
| 133 |
return result; |
134 |
return result; |
| 134 |
|
135 |
|
|
|
136 |
snprintf(format, sizeof(format), "%%%d[^=]=%%%d[^\n\r] ", sizeof(key)-1, sizeof(value)-1); |
| 137 |
|
| 135 |
//strcpy(root, path); |
138 |
//strcpy(root, path); |
| 136 |
root = path; |
139 |
root = path; |
| 137 |
cp = strrchr(root.c_str(), DIR_MARKER); |
140 |
cp = strrchr(root.c_str(), DIR_MARKER); |
|
Lines 142-150
Error PLS::ReadPlaylist(const char* url,
Link Here
|
| 142 |
return kError_FileNotFound; |
145 |
return kError_FileNotFound; |
| 143 |
len = -1; |
146 |
len = -1; |
| 144 |
while(!feof(fp)){ |
147 |
while(!feof(fp)){ |
| 145 |
if (fscanf(fp, " [%[^]]] ", key)) |
148 |
if (fscanf(fp, " [%*[^]]] ")) |
| 146 |
continue; |
149 |
continue; |
| 147 |
if (fscanf(fp, "%[^=]=%[^\n\r] ", key, value)){ |
150 |
if (fscanf(fp, format, key, value)) { |
| 148 |
if (strncmp(key, "File", 4) == 0){ |
151 |
if (strncmp(key, "File", 4) == 0){ |
| 149 |
if (file.length()){ |
152 |
if (file.length()){ |
| 150 |
AddItem(list, file, title, len, root); |
153 |
AddItem(list, file, title, len, root); |