A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

Revert r30818

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30821 a1c6a512-1295-4272-9138-f99709370657

+12
+12
firmware/lru.c
··· 23 struct lru_node 24 { 25 short _next; 26 unsigned char data[1]; /* place holder */ 27 }; 28 ··· 47 for (i=0; i<pl->_size; i++) 48 { 49 lru_node_p(pl, i)->_next = i + 1; 50 } 51 52 /* Fix up head and tail to form circular buffer */ 53 lru_node_p(pl, pl->_tail)->_next = pl->_head; 54 } 55 ··· 89 90 /* Remove current node from linked list */ 91 struct lru_node* curr_node = lru_node_p(pl, handle); 92 93 /* insert current node at tail */ 94 struct lru_node* tail_node = lru_node_p(pl, pl->_tail); 95 96 curr_node->_next = tail_node->_next; 97 tail_node->_next = handle; 98 99 pl->_tail = handle;
··· 23 struct lru_node 24 { 25 short _next; 26 + short _prev; 27 unsigned char data[1]; /* place holder */ 28 }; 29 ··· 48 for (i=0; i<pl->_size; i++) 49 { 50 lru_node_p(pl, i)->_next = i + 1; 51 + lru_node_p(pl, i)->_prev = i - 1; 52 } 53 54 /* Fix up head and tail to form circular buffer */ 55 + lru_node_p(pl, 0)->_prev = pl->_tail; 56 lru_node_p(pl, pl->_tail)->_next = pl->_head; 57 } 58 ··· 92 93 /* Remove current node from linked list */ 94 struct lru_node* curr_node = lru_node_p(pl, handle); 95 + struct lru_node* prev_node = lru_node_p(pl, curr_node->_prev); 96 + struct lru_node* next_node = lru_node_p(pl, curr_node->_next); 97 + 98 + prev_node->_next = curr_node->_next; 99 + next_node->_prev = curr_node->_prev; 100 101 /* insert current node at tail */ 102 struct lru_node* tail_node = lru_node_p(pl, pl->_tail); 103 + short tail_node_next_handle = tail_node->_next; /* Bug fix */ 104 + struct lru_node* tail_node_next = lru_node_p(pl, tail_node_next_handle); /* Bug fix */ 105 106 curr_node->_next = tail_node->_next; 107 + curr_node->_prev = pl->_tail; 108 + tail_node_next->_prev = handle; /* Bug fix */ 109 tail_node->_next = handle; 110 111 pl->_tail = handle;