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

Purge the usage of DSP_SWITCH_FREQUENCY.

DSP_SWITCH_FREQUENCY has been deprecated and the same enumerated value
as DSP_SET_FREQUENCY since major DSP revisions were committed. This
task should have been performed much earlier but, oh well, do it now.

Change-Id: I3f30d651b894136a07c7e17f78fc16a7d98631ff

+27 -28
+1 -1
apps/plugins/mpegplayer/audio_thread.c
··· 621 if (frame.header.samplerate != td.samplerate) 622 { 623 td.samplerate = frame.header.samplerate; 624 - rb->dsp_configure(td.dsp, DSP_SWITCH_FREQUENCY, 625 td.samplerate); 626 } 627
··· 621 if (frame.header.samplerate != td.samplerate) 622 { 623 td.samplerate = frame.header.samplerate; 624 + rb->dsp_configure(td.dsp, DSP_SET_FREQUENCY, 625 td.samplerate); 626 } 627
+1 -1
lib/rbcodec/codecs/a52.c
··· 142 if (codec_init()) 143 return CODEC_ERROR; 144 145 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 146 codec_set_replaygain(ci->id3); 147 148 /* Intialise the A52 decoder and check for success */
··· 142 if (codec_init()) 143 return CODEC_ERROR; 144 145 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 146 codec_set_replaygain(ci->id3); 147 148 /* Intialise the A52 decoder and check for success */
+1 -1
lib/rbcodec/codecs/a52_rm.c
··· 157 158 resume_offset = ci->id3->offset; 159 160 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 161 codec_set_replaygain(ci->id3); 162 163 ci->seek_buffer(ci->id3->first_frame_offset);
··· 157 158 resume_offset = ci->id3->offset; 159 160 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 161 codec_set_replaygain(ci->id3); 162 163 ci->seek_buffer(ci->id3->first_frame_offset);
+1 -1
lib/rbcodec/codecs/aac.c
··· 84 85 file_offset = ci->id3->offset; 86 87 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 88 codec_set_replaygain(ci->id3); 89 90 stream_create(&input_stream,ci);
··· 84 85 file_offset = ci->id3->offset; 86 87 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 88 codec_set_replaygain(ci->id3); 89 90 stream_create(&input_stream,ci);
+1 -1
lib/rbcodec/codecs/adx.c
··· 218 ci->set_elapsed(0); 219 220 /* setup pcm buffer format */ 221 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 222 if (channels == 2) { 223 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED); 224 } else if (channels == 1) {
··· 218 ci->set_elapsed(0); 219 220 /* setup pcm buffer format */ 221 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 222 if (channels == 2) { 223 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED); 224 } else if (channels == 1) {
+1 -1
lib/rbcodec/codecs/aiff.c
··· 234 return CODEC_ERROR; 235 } 236 237 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 238 239 if (format.channels == 2) { 240 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED);
··· 234 return CODEC_ERROR; 235 } 236 237 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 238 239 if (format.channels == 2) { 240 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED);
+1 -1
lib/rbcodec/codecs/alac.c
··· 64 return CODEC_ERROR; 65 } 66 67 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 68 codec_set_replaygain(ci->id3); 69 70 ci->seek_buffer(0);
··· 64 return CODEC_ERROR; 65 } 66 67 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 68 codec_set_replaygain(ci->id3); 69 70 ci->seek_buffer(0);
+1 -1
lib/rbcodec/codecs/ape.c
··· 200 (ape_ctx.seektablefilepos + 201 ape_ctx.numseekpoints * sizeof(uint32_t))); 202 203 - ci->configure(DSP_SWITCH_FREQUENCY, ape_ctx.samplerate); 204 ci->configure(DSP_SET_STEREO_MODE, ape_ctx.channels == 1 ? 205 STEREO_MONO : STEREO_NONINTERLEAVED); 206 codec_set_replaygain(ci->id3);
··· 200 (ape_ctx.seektablefilepos + 201 ape_ctx.numseekpoints * sizeof(uint32_t))); 202 203 + ci->configure(DSP_SET_FREQUENCY, ape_ctx.samplerate); 204 ci->configure(DSP_SET_STEREO_MODE, ape_ctx.channels == 1 ? 205 STEREO_MONO : STEREO_NONINTERLEAVED); 206 codec_set_replaygain(ci->id3);
+1 -1
lib/rbcodec/codecs/au.c
··· 225 return CODEC_ERROR; 226 } 227 228 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 229 if (format.channels == 2) { 230 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED); 231 } else if (format.channels == 1) {
··· 225 return CODEC_ERROR; 226 } 227 228 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 229 if (format.channels == 2) { 230 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED); 231 } else if (format.channels == 1) {
+1 -1
lib/rbcodec/codecs/flac.c
··· 476 return CODEC_ERROR; 477 } 478 479 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 480 ci->configure(DSP_SET_STEREO_MODE, fc.channels == 1 ? 481 STEREO_MONO : STEREO_NONINTERLEAVED); 482 codec_set_replaygain(ci->id3);
··· 476 return CODEC_ERROR; 477 } 478 479 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 480 ci->configure(DSP_SET_STEREO_MODE, fc.channels == 1 ? 481 STEREO_MONO : STEREO_NONINTERLEAVED); 482 codec_set_replaygain(ci->id3);
+2 -2
lib/rbcodec/codecs/mpa.c
··· 342 343 file_end = 0; 344 345 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 346 current_frequency = ci->id3->frequency; 347 codec_set_replaygain(ci->id3); 348 ··· 475 /* Check if sample rate and stereo settings changed in this frame. */ 476 if (frame.header.samplerate != current_frequency) { 477 current_frequency = frame.header.samplerate; 478 - ci->configure(DSP_SWITCH_FREQUENCY, current_frequency); 479 } 480 if (MAD_NCHANNELS(&frame.header) == 2) { 481 if (current_stereo_mode != STEREO_NONINTERLEAVED) {
··· 342 343 file_end = 0; 344 345 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 346 current_frequency = ci->id3->frequency; 347 codec_set_replaygain(ci->id3); 348 ··· 475 /* Check if sample rate and stereo settings changed in this frame. */ 476 if (frame.header.samplerate != current_frequency) { 477 current_frequency = frame.header.samplerate; 478 + ci->configure(DSP_SET_FREQUENCY, current_frequency); 479 } 480 if (MAD_NCHANNELS(&frame.header) == 2) { 481 if (current_stereo_mode != STEREO_NONINTERLEAVED) {
+1 -1
lib/rbcodec/codecs/mpc.c
··· 102 103 byterate = (mpc_uint32_t)(info.average_bitrate) / 8; 104 frequency = info.sample_freq / 100; /* 0.1 kHz accuracy */ 105 - ci->configure(DSP_SWITCH_FREQUENCY, info.sample_freq); 106 107 /* Remark: rockbox offset is the file offset in bytes. So, estimate the 108 * sample seek position from the file offset, the sampling frequency and
··· 102 103 byterate = (mpc_uint32_t)(info.average_bitrate) / 8; 104 frequency = info.sample_freq / 100; /* 0.1 kHz accuracy */ 105 + ci->configure(DSP_SET_FREQUENCY, info.sample_freq); 106 107 /* Remark: rockbox offset is the file offset in bytes. So, estimate the 108 * sample seek position from the file offset, the sampling frequency and
+1 -1
lib/rbcodec/codecs/raac.c
··· 79 ci->seek_buffer(0); 80 81 init_rm(&rmctx); 82 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 83 codec_set_replaygain(ci->id3); 84 85 /* initialise the sound converter */
··· 79 ci->seek_buffer(0); 80 81 init_rm(&rmctx); 82 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 83 codec_set_replaygain(ci->id3); 84 85 /* initialise the sound converter */
+1 -1
lib/rbcodec/codecs/shorten.c
··· 82 } 83 84 ci->id3->frequency = sc.sample_rate; 85 - ci->configure(DSP_SWITCH_FREQUENCY, sc.sample_rate); 86 87 if (sc.sample_rate) { 88 ci->id3->length = (sc.totalsamples / sc.sample_rate) * 1000;
··· 82 } 83 84 ci->id3->frequency = sc.sample_rate; 85 + ci->configure(DSP_SET_FREQUENCY, sc.sample_rate); 86 87 if (sc.sample_rate) { 88 ci->id3->length = (sc.totalsamples / sc.sample_rate) * 1000;
+1 -1
lib/rbcodec/codecs/sid.c
··· 1235 { 1236 if (reason == CODEC_LOAD) { 1237 /* Make use of 44.1khz */ 1238 - ci->configure(DSP_SWITCH_FREQUENCY, SAMPLE_RATE); 1239 /* Sample depth is 28 bit host endian */ 1240 ci->configure(DSP_SET_SAMPLE_DEPTH, 28); 1241 /* Mono output */
··· 1235 { 1236 if (reason == CODEC_LOAD) { 1237 /* Make use of 44.1khz */ 1238 + ci->configure(DSP_SET_FREQUENCY, SAMPLE_RATE); 1239 /* Sample depth is 28 bit host endian */ 1240 ci->configure(DSP_SET_SAMPLE_DEPTH, 28); 1241 /* Mono output */
+1 -1
lib/rbcodec/codecs/smaf.c
··· 394 return CODEC_ERROR; 395 } 396 397 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 398 399 if (format.channels == 2) { 400 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED);
··· 394 return CODEC_ERROR; 395 } 396 397 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 398 399 if (format.channels == 2) { 400 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED);
+1 -1
lib/rbcodec/codecs/tta.c
··· 67 68 codec_set_replaygain(ci->id3); 69 70 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 71 if (info.NCH == 2) { 72 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED); 73 } else if (info.NCH == 1) {
··· 67 68 codec_set_replaygain(ci->id3); 69 70 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 71 if (info.NCH == 2) { 72 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED); 73 } else if (info.NCH == 1) {
+1 -1
lib/rbcodec/codecs/vorbis.c
··· 91 return false; 92 } 93 94 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 95 codec_set_replaygain(ci->id3); 96 97 if (vi->channels == 2) {
··· 91 return false; 92 } 93 94 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 95 codec_set_replaygain(ci->id3); 96 97 if (vi->channels == 2) {
+1 -1
lib/rbcodec/codecs/vox.c
··· 119 return CODEC_ERROR; 120 } 121 122 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 123 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO); 124 125 /* make sure we're at the correct offset */
··· 119 return CODEC_ERROR; 120 } 121 122 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 123 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO); 124 125 /* make sure we're at the correct offset */
+1 -1
lib/rbcodec/codecs/wav.c
··· 350 return CODEC_ERROR; 351 } 352 353 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 354 if (format.channels == 2) { 355 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED); 356 } else if (format.channels == 1) {
··· 350 return CODEC_ERROR; 351 } 352 353 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 354 if (format.channels == 2) { 355 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED); 356 } else if (format.channels == 1) {
+1 -1
lib/rbcodec/codecs/wav64.c
··· 352 return CODEC_ERROR; 353 } 354 355 - ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency); 356 if (format.channels == 2) { 357 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED); 358 } else if (format.channels == 1) {
··· 352 return CODEC_ERROR; 353 } 354 355 + ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); 356 if (format.channels == 2) { 357 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED); 358 } else if (format.channels == 1) {
+1 -1
lib/rbcodec/codecs/wavpack.c
··· 68 if (!wpc) 69 return CODEC_ERROR; 70 71 - ci->configure(DSP_SWITCH_FREQUENCY, WavpackGetSampleRate (wpc)); 72 codec_set_replaygain(ci->id3); 73 /* bps = WavpackGetBytesPerSample (wpc); */ 74 nchans = WavpackGetReducedChannels (wpc);
··· 68 if (!wpc) 69 return CODEC_ERROR; 70 71 + ci->configure(DSP_SET_FREQUENCY, WavpackGetSampleRate (wpc)); 72 codec_set_replaygain(ci->id3); 73 /* bps = WavpackGetBytesPerSample (wpc); */ 74 nchans = WavpackGetReducedChannels (wpc);
+1 -1
lib/rbcodec/codecs/wma.c
··· 96 ci->set_elapsed(elapsedtime); 97 98 resume_offset = 0; 99 - ci->configure(DSP_SWITCH_FREQUENCY, wfx.rate); 100 ci->configure(DSP_SET_STEREO_MODE, wfx.channels == 1 ? 101 STEREO_MONO : STEREO_NONINTERLEAVED); 102 codec_set_replaygain(ci->id3);
··· 96 ci->set_elapsed(elapsedtime); 97 98 resume_offset = 0; 99 + ci->configure(DSP_SET_FREQUENCY, wfx.rate); 100 ci->configure(DSP_SET_STEREO_MODE, wfx.channels == 1 ? 101 STEREO_MONO : STEREO_NONINTERLEAVED); 102 codec_set_replaygain(ci->id3);
+1 -1
lib/rbcodec/codecs/wmapro.c
··· 65 saves us from parsing it again here. */ 66 memcpy(&wfx, ci->id3->toc, sizeof(wfx)); 67 68 - ci->configure(DSP_SWITCH_FREQUENCY, wfx.rate); 69 ci->configure(DSP_SET_STEREO_MODE, wfx.channels == 1 ? 70 STEREO_MONO : STEREO_NONINTERLEAVED); 71 codec_set_replaygain(ci->id3);
··· 65 saves us from parsing it again here. */ 66 memcpy(&wfx, ci->id3->toc, sizeof(wfx)); 67 68 + ci->configure(DSP_SET_FREQUENCY, wfx.rate); 69 ci->configure(DSP_SET_STEREO_MODE, wfx.channels == 1 ? 70 STEREO_MONO : STEREO_NONINTERLEAVED); 71 codec_set_replaygain(ci->id3);
+1 -1
lib/rbcodec/codecs/wmavoice.c
··· 90 memset(&avctx, 0, sizeof(AVCodecContext)); 91 memset(&avpkt, 0, sizeof(AVPacket)); 92 93 - ci->configure(DSP_SWITCH_FREQUENCY, wfx.rate); 94 ci->configure(DSP_SET_STEREO_MODE, wfx.channels == 1 ? 95 STEREO_MONO : STEREO_INTERLEAVED); 96 codec_set_replaygain(ci->id3);
··· 90 memset(&avctx, 0, sizeof(AVCodecContext)); 91 memset(&avpkt, 0, sizeof(AVPacket)); 92 93 + ci->configure(DSP_SET_FREQUENCY, wfx.rate); 94 ci->configure(DSP_SET_STEREO_MODE, wfx.channels == 1 ? 95 STEREO_MONO : STEREO_INTERLEAVED); 96 codec_set_replaygain(ci->id3);
-1
lib/rbcodec/dsp/dsp_core.h
··· 35 DSP_INIT, /* For dsp_init */ 36 DSP_RESET, 37 DSP_SET_FREQUENCY, 38 - DSP_SWITCH_FREQUENCY = DSP_SET_FREQUENCY, /* deprecated */ 39 DSP_SET_SAMPLE_DEPTH, 40 DSP_SET_STEREO_MODE, 41 DSP_FLUSH,
··· 35 DSP_INIT, /* For dsp_init */ 36 DSP_RESET, 37 DSP_SET_FREQUENCY, 38 DSP_SET_SAMPLE_DEPTH, 39 DSP_SET_STEREO_MODE, 40 DSP_FLUSH,
+1 -1
lib/rbcodec/test/warble.c
··· 577 dsp_configure(ci.dsp, setting, value); 578 } else { 579 if (setting == DSP_SET_FREQUENCY 580 - || setting == DSP_SWITCH_FREQUENCY) 581 format.freq = value; 582 else if (setting == DSP_SET_SAMPLE_DEPTH) 583 format.depth = value;
··· 577 dsp_configure(ci.dsp, setting, value); 578 } else { 579 if (setting == DSP_SET_FREQUENCY 580 + || setting == DSP_SET_FREQUENCY) 581 format.freq = value; 582 else if (setting == DSP_SET_SAMPLE_DEPTH) 583 format.depth = value;