Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Provide dealloc function to sansapatcher.

Similar as done with ipodpatcher provide a function to free the allocated
sector buffer.

Change-Id: Ie51e82f7191496bb48973148af1cc35cd37993d3

+27 -4
+1 -2
rbutil/rbutilqt/base/autodetection.cpp
··· 185 185 else { 186 186 qDebug() << "[Autodetect] sansapatcher: no Sansa found." << n; 187 187 } 188 - free(sansa.sectorbuf); 189 - sansa.sectorbuf = NULL; 188 + sansa_dealloc_buffer(&sansa); 190 189 191 190 if(m_mountpoint.isEmpty() && m_device.isEmpty() 192 191 && m_errdev.isEmpty() && m_incompat.isEmpty())
+1 -2
rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
··· 36 36 BootloaderInstallSansa::~BootloaderInstallSansa() 37 37 { 38 38 if(sansa.sectorbuf) { 39 - free(sansa.sectorbuf); 40 - sansa.sectorbuf = NULL; 39 + sansa_dealloc_buffer(&sansa); 41 40 } 42 41 } 43 42
+1
rbutil/sansapatcher/main.c
··· 404 404 } 405 405 406 406 sansa_close(&sansa); 407 + sansa_dealloc_buffer(&sansa); 407 408 408 409 if (action==INTERACTIVE) { 409 410 printf("Press ENTER to exit sansapatcher :");
+10
rbutil/sansapatcher/sansaio-posix.c
··· 122 122 return 0; 123 123 } 124 124 125 + int sansa_dealloc_buffer(struct sansa_t* sansa) 126 + { 127 + if (sansa->sectorbuf == NULL) { 128 + return -1; 129 + } 130 + free(sansa->sectorbuf); 131 + sansa->sectorbuf = NULL; 132 + return 0; 133 + } 134 + 125 135 int sansa_seek(struct sansa_t* sansa, loff_t pos) 126 136 { 127 137 off_t res;
+13
rbutil/sansapatcher/sansaio-win32.c
··· 162 162 return 0; 163 163 } 164 164 165 + int sansa_dealloc_buffer(struct sansa_t* sansa) 166 + { 167 + if (sansa->sectorbuf == NULL) { 168 + return -1; 169 + } 170 + if(!VirtualFree(sansa->sectorbuf, 0, MEM_RELEASE)) { 171 + sansa_print_error(" Error releasing buffer "); 172 + return -1; 173 + } 174 + sansa->sectorbuf = NULL; 175 + return 0; 176 + } 177 + 165 178 int sansa_seek(struct sansa_t* sansa, loff_t pos) 166 179 { 167 180 LARGE_INTEGER li;
+1
rbutil/sansapatcher/sansaio.h
··· 80 80 int sansa_read(struct sansa_t* sansa, unsigned char* buf, int nbytes); 81 81 int sansa_write(struct sansa_t* sansa, int nbytes); 82 82 int sansa_alloc_buffer(struct sansa_t* sansa, int bufsize); 83 + int sansa_dealloc_buffer(struct sansa_t* sansa); 83 84 84 85 #ifdef __cplusplus 85 86 }