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.

Remove explicit 'enum codec_command_action' in codec API

Just use long so the compiler potentially doesn't complain about
use of other values not in the enum. It's also the type used
around the system for event ids.

Increase min codec API version.

No functional changes.

Change-Id: If4419b42912f5e4ef673adcdeb69313e503f94cc

+55 -52
+2 -3
apps/codec_thread.c
··· 349 349 dsp_configure(ci.dsp, setting, value); 350 350 } 351 351 352 - static enum codec_command_action 353 - codec_get_command_callback(intptr_t *param) 352 + static long codec_get_command_callback(intptr_t *param) 354 353 { 355 354 yield(); 356 355 ··· 361 360 be expected) */ 362 361 while (1) 363 362 { 364 - enum codec_command_action action = CODEC_ACTION_NULL; 363 + long action = CODEC_ACTION_NULL; 365 364 struct queue_event ev; 366 365 367 366 queue_peek(&codec_queue, &ev); /* Find out what it is */
+1 -1
lib/rbcodec/codecs/a52.c
··· 173 173 /* The main decoding loop */ 174 174 175 175 while (1) { 176 - enum codec_command_action action = ci->get_command(&param); 176 + long action = ci->get_command(&param); 177 177 178 178 if (action == CODEC_ACTION_HALT) 179 179 break;
+1 -1
lib/rbcodec/codecs/a52_rm.c
··· 148 148 int consumed, packet_offset; 149 149 int playback_on = -1; 150 150 size_t resume_offset; 151 - enum codec_command_action action; 151 + long action; 152 152 intptr_t param; 153 153 154 154 if (codec_init()) {
+1 -1
lib/rbcodec/codecs/aac.c
··· 72 72 uint32_t sbr_fac = 1; 73 73 unsigned char c = 0; 74 74 void *ret; 75 - enum codec_command_action action; 75 + long action; 76 76 intptr_t param; 77 77 bool empty_first_frame = false; 78 78
+1 -1
lib/rbcodec/codecs/adx.c
··· 236 236 /* The main decoder loop */ 237 237 238 238 while (!endofstream) { 239 - enum codec_command_action action = ci->get_command(&param); 239 + long action = ci->get_command(&param); 240 240 241 241 if (action == CODEC_ACTION_HALT) 242 242 break;
+1 -1
lib/rbcodec/codecs/aiff.c
··· 305 305 endofstream = 0; 306 306 307 307 while (!endofstream) { 308 - enum codec_command_action action = ci->get_command(&param); 308 + long action = ci->get_command(&param); 309 309 310 310 if (action == CODEC_ACTION_HALT) 311 311 break;
+1 -1
lib/rbcodec/codecs/aiff_enc.c
··· 207 207 /* main encoding loop */ 208 208 while (1) 209 209 { 210 - enum codec_command_action action = ci->get_command(NULL); 210 + long action = ci->get_command(NULL); 211 211 212 212 if (action != CODEC_ACTION_NULL) 213 213 break;
+1 -1
lib/rbcodec/codecs/alac.c
··· 109 109 110 110 /* The main decoding loop */ 111 111 while (i < demux_res.num_sample_byte_sizes) { 112 - enum codec_command_action action = ci->get_command(&param); 112 + long action = ci->get_command(&param); 113 113 114 114 if (action == CODEC_ACTION_HALT) 115 115 break;
+1 -1
lib/rbcodec/codecs/ape.c
··· 155 155 int res; 156 156 int firstbyte; 157 157 size_t resume_offset; 158 - enum codec_command_action action; 158 + long action; 159 159 intptr_t param; 160 160 161 161 if (codec_init()) {
+1 -1
lib/rbcodec/codecs/asap.c
··· 107 107 108 108 /* The main decoder loop */ 109 109 while (1) { 110 - enum codec_command_action action = ci->get_command(&param); 110 + long action = ci->get_command(&param); 111 111 112 112 if (action == CODEC_ACTION_HALT) 113 113 break;
+1 -1
lib/rbcodec/codecs/atrac3_oma.c
··· 50 50 int elapsed = 0; 51 51 size_t resume_offset; 52 52 intptr_t param; 53 - enum codec_command_action action; 53 + long action; 54 54 55 55 if (codec_init()) { 56 56 DEBUGF("codec init failed\n");
+1 -1
lib/rbcodec/codecs/atrac3_rm.c
··· 61 61 int playback_on = -1; 62 62 size_t resume_offset; 63 63 intptr_t param; 64 - enum codec_command_action action; 64 + long action; 65 65 66 66 if (codec_init()) { 67 67 DEBUGF("codec init failed\n");
+1 -1
lib/rbcodec/codecs/au.c
··· 270 270 endofstream = 0; 271 271 272 272 while (!endofstream) { 273 - enum codec_command_action action = ci->get_command(&param); 273 + long action = ci->get_command(&param); 274 274 275 275 if (action == CODEC_ACTION_HALT) 276 276 break;
+1 -1
lib/rbcodec/codecs/ay.c
··· 97 97 98 98 /* The main decoder loop */ 99 99 while (1) { 100 - enum codec_command_action action = ci->get_command(&param); 100 + long action = ci->get_command(&param); 101 101 102 102 if (action == CODEC_ACTION_HALT) 103 103 break;
+7 -3
lib/rbcodec/codecs/codecs.h
··· 46 46 #include "gcc_extensions.h" 47 47 #include "load_code.h" 48 48 49 + #include <limits.h> 50 + 49 51 #ifdef CODEC 50 52 #if defined(DEBUG) || defined(SIMULATOR) 51 53 #undef DEBUGF ··· 72 74 #define CODEC_ENC_MAGIC 0x52454E43 /* RENC */ 73 75 74 76 /* increase this every time the api struct changes */ 75 - #define CODEC_API_VERSION 47 77 + #define CODEC_API_VERSION 48 76 78 77 79 /* update this to latest version if a change to the api struct breaks 78 80 backwards compatibility (and please take the opportunity to sort in any 79 81 new function which are "waiting" at the end of the function table) */ 80 - #define CODEC_MIN_API_VERSION 47 82 + #define CODEC_MIN_API_VERSION 48 81 83 82 84 /* reasons for calling codec main entrypoint */ 83 85 enum codec_entry_call_reason { ··· 99 101 #ifdef HAVE_RECORDING 100 102 CODEC_ACTION_STREAM_FINISH = 2, 101 103 #endif 104 + CODEC_ACTION_MIN = LONG_MIN, 105 + CODEC_ACTION_MAX = LONG_MAX, 102 106 }; 103 107 104 108 /* NOTE: To support backwards compatibility, only add new functions at ··· 144 148 /* Configure different codec buffer parameters. */ 145 149 void (*configure)(int setting, intptr_t value); 146 150 /* Obtain command action on what to do next */ 147 - enum codec_command_action (*get_command)(intptr_t *param); 151 + long (*get_command)(intptr_t *param); 148 152 /* Determine whether the track should be looped, if applicable. */ 149 153 bool (*loop_track)(void); 150 154
+1 -1
lib/rbcodec/codecs/cook.c
··· 57 57 int scrambling_unit_size, num_units; 58 58 size_t resume_offset; 59 59 intptr_t param; 60 - enum codec_command_action action; 60 + long action; 61 61 62 62 if (codec_init()) { 63 63 DEBUGF("codec init failed\n");
+1 -1
lib/rbcodec/codecs/flac.c
··· 498 498 frame=0; 499 499 buf = ci->request_buffer(&bytesleft, MAX_FRAMESIZE); 500 500 while (bytesleft) { 501 - enum codec_command_action action = ci->get_command(&param); 501 + long action = ci->get_command(&param); 502 502 503 503 if (action == CODEC_ACTION_HALT) 504 504 break;
+1 -1
lib/rbcodec/codecs/gbs.c
··· 86 86 87 87 /* The main decoder loop */ 88 88 while (1) { 89 - enum codec_command_action action = ci->get_command(&param); 89 + long action = ci->get_command(&param); 90 90 91 91 if (action == CODEC_ACTION_HALT) 92 92 break;
+1 -1
lib/rbcodec/codecs/hes.c
··· 86 86 87 87 /* The main decoder loop */ 88 88 while ( 1 ) { 89 - enum codec_command_action action = ci->get_command(&param); 89 + long action = ci->get_command(&param); 90 90 91 91 if (action == CODEC_ACTION_HALT) 92 92 break;
+1 -1
lib/rbcodec/codecs/kss.c
··· 89 89 90 90 /* The main decoder loop */ 91 91 while (1) { 92 - enum codec_command_action action = ci->get_command(&param); 92 + long action = ci->get_command(&param); 93 93 94 94 if (action == CODEC_ACTION_HALT) 95 95 break;
+1 -1
lib/rbcodec/codecs/mod.c
··· 1333 1333 old_patterntableposition = 0; 1334 1334 1335 1335 while (1) { 1336 - enum codec_command_action action = ci->get_command(&param); 1336 + long action = ci->get_command(&param); 1337 1337 1338 1338 if (action == CODEC_ACTION_HALT) 1339 1339 break;
+1 -1
lib/rbcodec/codecs/mp3_enc.c
··· 2961 2961 while (1) 2962 2962 { 2963 2963 intptr_t param; 2964 - enum codec_command_action action = ci->get_command(&param); 2964 + long action = ci->get_command(&param); 2965 2965 2966 2966 if (action != CODEC_ACTION_NULL) 2967 2967 {
+1 -1
lib/rbcodec/codecs/mpa.c
··· 392 392 393 393 /* This is the decoding loop. */ 394 394 while (1) { 395 - enum codec_command_action action = ci->get_command(&param); 395 + long action = ci->get_command(&param); 396 396 397 397 if (action == CODEC_ACTION_HALT) 398 398 break;
+1 -1
lib/rbcodec/codecs/mpc.c
··· 148 148 /* This is the decoding loop. */ 149 149 do 150 150 { 151 - enum codec_command_action action = ci->get_command(&param); 151 + long action = ci->get_command(&param); 152 152 153 153 if (action == CODEC_ACTION_HALT) 154 154 return CODEC_OK;
+1 -1
lib/rbcodec/codecs/nsf.c
··· 95 95 96 96 /* The main decoder loop */ 97 97 while (1) { 98 - enum codec_command_action action = ci->get_command(&param); 98 + long action = ci->get_command(&param); 99 99 100 100 if (action == CODEC_ACTION_HALT) 101 101 break;
+1 -1
lib/rbcodec/codecs/opus.c
··· 314 314 enum codec_status codec_run(void) 315 315 { 316 316 int error = CODEC_ERROR; 317 - enum codec_command_action action; 317 + long action; 318 318 intptr_t param; 319 319 ogg_sync_state oy; 320 320 ogg_page og;
+1 -1
lib/rbcodec/codecs/raac.c
··· 63 63 unsigned char c = 0; /* channels */ 64 64 int playback_on = -1; 65 65 size_t resume_offset; 66 - enum codec_command_action action; 66 + long action; 67 67 intptr_t param; 68 68 69 69 if (codec_init()) {
+1 -1
lib/rbcodec/codecs/sgc.c
··· 101 101 102 102 /* The main decoder loop */ 103 103 while (1) { 104 - enum codec_command_action action = ci->get_command(&param); 104 + long action = ci->get_command(&param); 105 105 106 106 if (action == CODEC_ACTION_HALT) 107 107 break;
+1 -1
lib/rbcodec/codecs/shorten.c
··· 110 110 samplesdone = 0; 111 111 buf = ci->request_buffer(&bytesleft, MAX_BUFFER_SIZE); 112 112 while (bytesleft) { 113 - enum codec_command_action action = ci->get_command(&param); 113 + long action = ci->get_command(&param); 114 114 115 115 if (action == CODEC_ACTION_HALT) 116 116 break;
+1 -1
lib/rbcodec/codecs/sid.c
··· 1277 1277 1278 1278 /* The main decoder loop */ 1279 1279 while (1) { 1280 - enum codec_command_action action = ci->get_command(&param); 1280 + long action = ci->get_command(&param); 1281 1281 1282 1282 if (action == CODEC_ACTION_HALT) 1283 1283 break;
+1 -1
lib/rbcodec/codecs/smaf.c
··· 446 446 endofstream = 0; 447 447 448 448 while (!endofstream) { 449 - enum codec_command_action action = ci->get_command(&param); 449 + long action = ci->get_command(&param); 450 450 451 451 if (action == CODEC_ACTION_HALT) 452 452 break;
+1 -1
lib/rbcodec/codecs/spc.c
··· 453 453 454 454 while ( 1 ) 455 455 { 456 - enum codec_command_action action = ci->get_command(&param); 456 + long action = ci->get_command(&param); 457 457 458 458 if (action == CODEC_ACTION_HALT) 459 459 break;
+1 -1
lib/rbcodec/codecs/speex.c
··· 405 405 unsigned long strtoffset; 406 406 void *st = NULL; 407 407 int j = 0; 408 - enum codec_command_action action; 408 + long action; 409 409 intptr_t param; 410 410 411 411 memset(&bits, 0, sizeof(bits));
+1 -1
lib/rbcodec/codecs/tta.c
··· 104 104 105 105 while (!endofstream) 106 106 { 107 - enum codec_command_action action = ci->get_command(&param); 107 + long action = ci->get_command(&param); 108 108 109 109 if (action == CODEC_ACTION_HALT) 110 110 break;
+1 -1
lib/rbcodec/codecs/vgm.c
··· 135 135 136 136 /* The main decoder loop */ 137 137 while (1) { 138 - enum codec_command_action action = ci->get_command(&param); 138 + long action = ci->get_command(&param); 139 139 140 140 if (action == CODEC_ACTION_HALT) 141 141 break;
+1 -1
lib/rbcodec/codecs/vorbis.c
··· 206 206 previous_section = -1; 207 207 208 208 while (1) { 209 - enum codec_command_action action = ci->get_command(&param); 209 + long action = ci->get_command(&param); 210 210 211 211 if (action == CODEC_ACTION_HALT) 212 212 break;
+1 -1
lib/rbcodec/codecs/vox.c
··· 159 159 endofstream = 0; 160 160 161 161 while (!endofstream) { 162 - enum codec_command_action action = ci->get_command(&param); 162 + long action = ci->get_command(&param); 163 163 164 164 if (action == CODEC_ACTION_HALT) 165 165 break;
+1 -1
lib/rbcodec/codecs/wav.c
··· 396 396 endofstream = 0; 397 397 398 398 while (!endofstream) { 399 - enum codec_command_action action = ci->get_command(&param); 399 + long action = ci->get_command(&param); 400 400 401 401 if (action == CODEC_ACTION_HALT) 402 402 break;
+1 -1
lib/rbcodec/codecs/wav64.c
··· 400 400 endofstream = 0; 401 401 402 402 while (!endofstream) { 403 - enum codec_command_action action = ci->get_command(&param); 403 + long action = ci->get_command(&param); 404 404 405 405 if (action == CODEC_ACTION_HALT) 406 406 break;
+1 -1
lib/rbcodec/codecs/wav_enc.c
··· 188 188 /* main encoding loop */ 189 189 while (1) 190 190 { 191 - enum codec_command_action action = ci->get_command(NULL); 191 + long action = ci->get_command(NULL); 192 192 193 193 if (action != CODEC_ACTION_NULL) 194 194 break;
+1 -1
lib/rbcodec/codecs/wavpack.c
··· 90 90 91 91 while (1) { 92 92 int32_t nsamples; 93 - enum codec_command_action action = ci->get_command(&param); 93 + long action = ci->get_command(&param); 94 94 95 95 if (action == CODEC_ACTION_HALT) 96 96 break;
+1 -1
lib/rbcodec/codecs/wavpack_enc.c
··· 353 353 /* main encoding loop */ 354 354 while (1) 355 355 { 356 - enum codec_command_action action = ci->get_command(NULL); 356 + long action = ci->get_command(NULL); 357 357 358 358 if (action != CODEC_ACTION_NULL) 359 359 break;
+1 -1
lib/rbcodec/codecs/wma.c
··· 52 52 int audiobufsize; 53 53 int packetlength = 0; 54 54 int errcount = 0; 55 - enum codec_command_action action; 55 + long action; 56 56 intptr_t param; 57 57 58 58 /* Remember the resume position - when the codec is opened, the
+1 -1
lib/rbcodec/codecs/wmapro.c
··· 93 93 94 94 while (pktcnt < wfx.numpackets) 95 95 { 96 - enum codec_command_action action = ci->get_command(&param); 96 + long action = ci->get_command(&param); 97 97 98 98 if (action == CODEC_ACTION_HALT) 99 99 break;
+1 -1
lib/rbcodec/codecs/wmavoice.c
··· 120 120 121 121 while (pktcnt < wfx.numpackets) 122 122 { 123 - enum codec_command_action action = ci->get_command(&param); 123 + long action = ci->get_command(&param); 124 124 125 125 if (action == CODEC_ACTION_HALT) 126 126 break;
+3 -3
lib/rbcodec/test/warble.c
··· 108 108 static uint32_t playback_vol_factor = VOL_FACTOR_UNITY; 109 109 110 110 static int input_fd; 111 - static enum codec_command_action codec_action; 111 + static long codec_action; 112 112 static intptr_t codec_action_param = 0; 113 113 static unsigned long num_output_samples = 0; 114 114 static struct codec_api ci; ··· 606 606 } 607 607 } 608 608 609 - static enum codec_command_action ci_get_command(intptr_t *param) 609 + static long ci_get_command(intptr_t *param) 610 610 { 611 - enum codec_command_action ret = codec_action; 611 + long ret = codec_action; 612 612 *param = codec_action_param; 613 613 codec_action = CODEC_ACTION_NULL; 614 614 return ret;