1
0
Fork 0
forked from len0rd/rockbox

Revert "Pictureflow Fixes: Sansa C200"

This reverts commit b7f2cc5d6d697aa40d8a568cf573ee100c32b9c4.

Change-Id: I51ec9f5fade10ce0173ed45739af6baaa5c7f746
This commit is contained in:
William Wilgus 2020-06-26 03:42:53 +00:00
parent 25b1e1b8bd
commit 7c291250ef

View file

@ -36,16 +36,12 @@
/* Capacity 10 000 entries (for example 10k different albums) */ /* Capacity 10 000 entries (for example 10k different albums) */
#if PLUGIN_BUFFER_SIZE > 0x10000 #if PLUGIN_BUFFER_SIZE > 0x10000
#define UNIQBUF_SIZE (64*1024) #define UNIQBUF_SIZE (64*1024)
#else #else /*Bugfix -- Several players havent enough Ram to allow such a large buffer */
#if PLUGIN_BUFFER_SIZE > 0x8000
/*Bugfix -- Several players havent enough Ram to allow such a large buffer */
#define UNIQBUF_SIZE (16*1024) #define UNIQBUF_SIZE (16*1024)
#else
#define UNIQBUF_SIZE 0
#endif
#endif #endif
static long uniqbuf[UNIQBUF_SIZE / sizeof(long)]; static long uniqbuf[UNIQBUF_SIZE / sizeof(long)];
@ -908,12 +904,8 @@ static int create_album_index(void)
artist_seek = artist[j].seek; artist_seek = artist[j].seek;
rb->memset(&tcs, 0, sizeof(struct tagcache_search) ); rb->memset(&tcs, 0, sizeof(struct tagcache_search) );
rb->tagcache_search(&tcs, tag_album); rb->tagcache_search(&tcs, tag_album);
#if UNIQBUF_SIZE > 0
/* Prevent duplicate entries in the search list. */ /* Prevent duplicate entries in the search list. */
rb->tagcache_search_set_uniqbuf(&tcs, uniqbuf, UNIQBUF_SIZE); rb->tagcache_search_set_uniqbuf(&tcs, uniqbuf, UNIQBUF_SIZE);
#else
(void) uniqbuf;
#endif
rb->tagcache_search_add_filter(&tcs, tag_albumartist, artist_seek); rb->tagcache_search_add_filter(&tcs, tag_albumartist, artist_seek);
while (rb->tagcache_get_next(&tcs)) while (rb->tagcache_get_next(&tcs))
{ {
@ -950,7 +942,7 @@ static int create_album_index(void)
static int save_album_index(void){ static int save_album_index(void){
int fd; int fd;
fd = rb->creat(CACHE_PREFIX PLUGIN_DEMOS_DATA_DIR "/album_ndx.tmp",0666); fd = rb->creat(PLUGIN_DIR "/demos/album_ndx.tmp",0666);
if(fd >= 0) if(fd >= 0)
{ {
int unsigned_size = sizeof(unsigned int); int unsigned_size = sizeof(unsigned int);
@ -973,7 +965,7 @@ static int save_album_index(void){
/*Loads the artists+albums index information stored in the hard drive*/ /*Loads the artists+albums index information stored in the hard drive*/
static int load_album_index(void){ static int load_album_index(void){
int fr = rb->open(CACHE_PREFIX PLUGIN_DEMOS_DATA_DIR "/album_ndx.tmp", O_RDONLY); int fr = rb->open(PLUGIN_DIR "/demos/album_ndx.tmp", O_RDONLY);
if (fr >= 0){ if (fr >= 0){
int unsigned_size = sizeof(unsigned int); int unsigned_size = sizeof(unsigned int);
int int_size = sizeof(int); int int_size = sizeof(int);
@ -1049,8 +1041,7 @@ static int get_wps_current_index(void)
for( i=0; i < album_count; i++ ) for( i=0; i < album_count; i++ )
{ {
if(!rb->strcmp(album_names + album[i].name_idx, id3->album) && if(!rb->strcmp(album_names + album[i].name_idx, id3->album) &&
!rb->strcmp(artist_names + artist[album[i].artist_idx].name_idx, !rb->strcmp(artist_names + artist[album[i].artist_idx].name_idx, id3->albumartist))
id3->albumartist))
return i; return i;
} }
} }
@ -1080,9 +1071,7 @@ static void create_track_index(const int slide_index)
goto fail; goto fail;
rb->tagcache_search_add_filter(&tcs, tag_album, album[slide_index].seek); rb->tagcache_search_add_filter(&tcs, tag_album, album[slide_index].seek);
rb->tagcache_search_add_filter(&tcs, tag_albumartist, rb->tagcache_search_add_filter(&tcs, tag_albumartist, artist[album[slide_index].artist_idx].seek);
artist[album[slide_index].artist_idx].seek);
track_count=0; track_count=0;
int string_index = 0, track_num; int string_index = 0, track_num;
int disc_num; int disc_num;
@ -1198,8 +1187,7 @@ static bool get_albumart_for_index_from_db(const int slide_index, char *buf,
bool result; bool result;
/* find the first track of the album */ /* find the first track of the album */
rb->tagcache_search_add_filter(&tcs, tag_album, album[slide_index].seek); rb->tagcache_search_add_filter(&tcs, tag_album, album[slide_index].seek);
rb->tagcache_search_add_filter(&tcs, tag_albumartist, rb->tagcache_search_add_filter(&tcs, tag_albumartist, artist[album[slide_index].artist_idx].seek);
artist[album[slide_index].artist_idx].seek);
if ( rb->tagcache_get_next(&tcs) ) { if ( rb->tagcache_get_next(&tcs) ) {
struct mp3entry id3; struct mp3entry id3;