diff options
author | William Wilgus <me.theuser@yahoo.com> | 2020-06-25 18:16:44 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2020-06-25 22:35:24 +0000 |
commit | 6f0fd91343afbd0268cd3027f6a56371721295a3 (patch) | |
tree | 52f87a137bc99b1f79ba1b55ea43ff8fc32b8a74 /apps/plugins/pictureflow/pictureflow.c | |
parent | f6448cb44053d1fccbb614a1bd674c912026008f (diff) | |
download | rockbox-6f0fd91343afbd0268cd3027f6a56371721295a3.tar.gz rockbox-6f0fd91343afbd0268cd3027f6a56371721295a3.zip |
Pictureflow Fixes: Sansa C200
Sansa C200 fix
Change-Id: I548b7142dde9ea4da5455686bed650aa40c9c90a
Diffstat (limited to 'apps/plugins/pictureflow/pictureflow.c')
-rw-r--r-- | apps/plugins/pictureflow/pictureflow.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index 3ccfc0d3a2..045596ce5a 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c | |||
@@ -36,12 +36,16 @@ | |||
36 | 36 | ||
37 | 37 | ||
38 | 38 | ||
39 | |||
40 | /* Capacity 10 000 entries (for example 10k different albums) */ | 39 | /* Capacity 10 000 entries (for example 10k different albums) */ |
41 | #if PLUGIN_BUFFER_SIZE > 0x10000 | 40 | #if PLUGIN_BUFFER_SIZE > 0x10000 |
42 | #define UNIQBUF_SIZE (64*1024) | 41 | #define UNIQBUF_SIZE (64*1024) |
43 | #else /*Bugfix -- Several players havent enough Ram to allow such a large buffer */ | 42 | #else |
44 | #define UNIQBUF_SIZE (16*1024) | 43 | #if PLUGIN_BUFFER_SIZE > 0x8000 |
44 | /*Bugfix -- Several players havent enough Ram to allow such a large buffer */ | ||
45 | #define UNIQBUF_SIZE (16*1024) | ||
46 | #else | ||
47 | #define UNIQBUF_SIZE 0 | ||
48 | #endif | ||
45 | #endif | 49 | #endif |
46 | static long uniqbuf[UNIQBUF_SIZE / sizeof(long)]; | 50 | static long uniqbuf[UNIQBUF_SIZE / sizeof(long)]; |
47 | 51 | ||
@@ -904,8 +908,12 @@ static int create_album_index(void) | |||
904 | artist_seek = artist[j].seek; | 908 | artist_seek = artist[j].seek; |
905 | rb->memset(&tcs, 0, sizeof(struct tagcache_search) ); | 909 | rb->memset(&tcs, 0, sizeof(struct tagcache_search) ); |
906 | rb->tagcache_search(&tcs, tag_album); | 910 | rb->tagcache_search(&tcs, tag_album); |
907 | /* Prevent duplicate entries in the search list. */ | 911 | #if UNIQBUF_SIZE > 0 |
912 | /* Prevent duplicate entries in the search list. */ | ||
908 | rb->tagcache_search_set_uniqbuf(&tcs, uniqbuf, UNIQBUF_SIZE); | 913 | rb->tagcache_search_set_uniqbuf(&tcs, uniqbuf, UNIQBUF_SIZE); |
914 | #else | ||
915 | (void) uniqbuf; | ||
916 | #endif | ||
909 | rb->tagcache_search_add_filter(&tcs, tag_albumartist, artist_seek); | 917 | rb->tagcache_search_add_filter(&tcs, tag_albumartist, artist_seek); |
910 | while (rb->tagcache_get_next(&tcs)) | 918 | while (rb->tagcache_get_next(&tcs)) |
911 | { | 919 | { |
@@ -942,7 +950,7 @@ static int create_album_index(void) | |||
942 | 950 | ||
943 | static int save_album_index(void){ | 951 | static int save_album_index(void){ |
944 | int fd; | 952 | int fd; |
945 | fd = rb->creat(PLUGIN_DIR "/demos/album_ndx.tmp",0666); | 953 | fd = rb->creat(CACHE_PREFIX PLUGIN_DEMOS_DATA_DIR "/album_ndx.tmp",0666); |
946 | if(fd >= 0) | 954 | if(fd >= 0) |
947 | { | 955 | { |
948 | int unsigned_size = sizeof(unsigned int); | 956 | int unsigned_size = sizeof(unsigned int); |
@@ -965,7 +973,7 @@ static int save_album_index(void){ | |||
965 | /*Loads the artists+albums index information stored in the hard drive*/ | 973 | /*Loads the artists+albums index information stored in the hard drive*/ |
966 | 974 | ||
967 | static int load_album_index(void){ | 975 | static int load_album_index(void){ |
968 | int fr = rb->open(PLUGIN_DIR "/demos/album_ndx.tmp", O_RDONLY); | 976 | int fr = rb->open(CACHE_PREFIX PLUGIN_DEMOS_DATA_DIR "/album_ndx.tmp", O_RDONLY); |
969 | if (fr >= 0){ | 977 | if (fr >= 0){ |
970 | int unsigned_size = sizeof(unsigned int); | 978 | int unsigned_size = sizeof(unsigned int); |
971 | int int_size = sizeof(int); | 979 | int int_size = sizeof(int); |
@@ -1041,7 +1049,8 @@ static int get_wps_current_index(void) | |||
1041 | for( i=0; i < album_count; i++ ) | 1049 | for( i=0; i < album_count; i++ ) |
1042 | { | 1050 | { |
1043 | if(!rb->strcmp(album_names + album[i].name_idx, id3->album) && | 1051 | if(!rb->strcmp(album_names + album[i].name_idx, id3->album) && |
1044 | !rb->strcmp(artist_names + artist[album[i].artist_idx].name_idx, id3->albumartist)) | 1052 | !rb->strcmp(artist_names + artist[album[i].artist_idx].name_idx, |
1053 | id3->albumartist)) | ||
1045 | return i; | 1054 | return i; |
1046 | } | 1055 | } |
1047 | } | 1056 | } |
@@ -1071,7 +1080,9 @@ static void create_track_index(const int slide_index) | |||
1071 | goto fail; | 1080 | goto fail; |
1072 | 1081 | ||
1073 | rb->tagcache_search_add_filter(&tcs, tag_album, album[slide_index].seek); | 1082 | rb->tagcache_search_add_filter(&tcs, tag_album, album[slide_index].seek); |
1074 | rb->tagcache_search_add_filter(&tcs, tag_albumartist, artist[album[slide_index].artist_idx].seek); | 1083 | rb->tagcache_search_add_filter(&tcs, tag_albumartist, |
1084 | artist[album[slide_index].artist_idx].seek); | ||
1085 | |||
1075 | track_count=0; | 1086 | track_count=0; |
1076 | int string_index = 0, track_num; | 1087 | int string_index = 0, track_num; |
1077 | int disc_num; | 1088 | int disc_num; |
@@ -1187,7 +1198,8 @@ static bool get_albumart_for_index_from_db(const int slide_index, char *buf, | |||
1187 | bool result; | 1198 | bool result; |
1188 | /* find the first track of the album */ | 1199 | /* find the first track of the album */ |
1189 | rb->tagcache_search_add_filter(&tcs, tag_album, album[slide_index].seek); | 1200 | rb->tagcache_search_add_filter(&tcs, tag_album, album[slide_index].seek); |
1190 | rb->tagcache_search_add_filter(&tcs, tag_albumartist, artist[album[slide_index].artist_idx].seek); | 1201 | rb->tagcache_search_add_filter(&tcs, tag_albumartist, |
1202 | artist[album[slide_index].artist_idx].seek); | ||
1191 | 1203 | ||
1192 | if ( rb->tagcache_get_next(&tcs) ) { | 1204 | if ( rb->tagcache_get_next(&tcs) ) { |
1193 | struct mp3entry id3; | 1205 | struct mp3entry id3; |