diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2006-11-26 12:02:47 +0000 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2006-11-26 12:02:47 +0000 |
| commit | bbef13eddfefffa1fbcf82185ed73c04a18d22eb (patch) | |
| tree | bf7d8a684d5031851185498db8388f60a29be662 /apps | |
| parent | 4049d44b03d4a17cbf2f48f5f1360ac397da5ef5 (diff) | |
| download | rockbox-bbef13eddfefffa1fbcf82185ed73c04a18d22eb.zip rockbox-bbef13eddfefffa1fbcf82185ed73c04a18d22eb.tar.gz rockbox-bbef13eddfefffa1fbcf82185ed73c04a18d22eb.tar.bz2 rockbox-bbef13eddfefffa1fbcf82185ed73c04a18d22eb.tar.xz | |
SWCODEC: Stop clicks between tracks when resampler is active by only switching the DSP frequency and not resetting the resampler at track boundaries. Will make sure DSP is correctly flushed at dicontinuities but don't hear any problems currently.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11600 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/codecs/a52.c | 2 | ||||
| -rw-r--r-- | apps/codecs/aac.c | 2 | ||||
| -rw-r--r-- | apps/codecs/adx.c | 2 | ||||
| -rw-r--r-- | apps/codecs/aiff.c | 4 | ||||
| -rw-r--r-- | apps/codecs/alac.c | 2 | ||||
| -rw-r--r-- | apps/codecs/flac.c | 2 | ||||
| -rw-r--r-- | apps/codecs/mpa.c | 2 | ||||
| -rw-r--r-- | apps/codecs/mpc.c | 2 | ||||
| -rw-r--r-- | apps/codecs/shorten.c | 2 | ||||
| -rw-r--r-- | apps/codecs/sid.c | 2 | ||||
| -rw-r--r-- | apps/codecs/vorbis.c | 2 | ||||
| -rw-r--r-- | apps/codecs/wav.c | 2 | ||||
| -rw-r--r-- | apps/codecs/wavpack.c | 2 | ||||
| -rw-r--r-- | apps/dsp.c | 6 | ||||
| -rw-r--r-- | apps/dsp.h | 1 | ||||
| -rw-r--r-- | apps/playback.c | 3 |
16 files changed, 23 insertions, 15 deletions
diff --git a/apps/codecs/a52.c b/apps/codecs/a52.c index 3d0c35d..b7190be 100644 --- a/apps/codecs/a52.c +++ b/apps/codecs/a52.c @@ -154,7 +154,7 @@ next_track: while (!ci->taginfo_ready) ci->yield(); - ci->configure(DSP_SET_FREQUENCY, (long *)(ci->id3->frequency)); + ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); /* Intialise the A52 decoder and check for success */ state = a52_init(0); diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c index a2248c6..3c9a637 100644 --- a/apps/codecs/aac.c +++ b/apps/codecs/aac.c @@ -90,7 +90,7 @@ next_track: sound_samples_done = ci->id3->offset; - ci->configure(DSP_SET_FREQUENCY, (long *)(rb->id3->frequency)); + ci->configure(DSP_SWITCH_FREQUENCY, (long *)(rb->id3->frequency)); codec_set_replaygain(rb->id3); stream_create(&input_stream,ci); diff --git a/apps/codecs/adx.c b/apps/codecs/adx.c index 902f3ce..803600b 100644 --- a/apps/codecs/adx.c +++ b/apps/codecs/adx.c @@ -161,7 +161,7 @@ next_track: bufoff = chanstart; /* setup pcm buffer format */ - ci->configure(DSP_SET_FREQUENCY, (long *)(ci->id3->frequency)); + ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); if (channels == 2) { ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_INTERLEAVED); } else if (channels == 1) { diff --git a/apps/codecs/aiff.c b/apps/codecs/aiff.c index 6ca03f1..479d405 100644 --- a/apps/codecs/aiff.c +++ b/apps/codecs/aiff.c @@ -81,6 +81,7 @@ enum codec_status codec_start(struct codec_api *api) ci->memset(iedata, 0, iend - iedata); #endif + ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)28); ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*256)); @@ -182,8 +183,7 @@ next_track: goto done; } - ci->configure(DSP_SET_FREQUENCY, (long *)(ci->id3->frequency)); - ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)28); + ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); if (num_channels == 2) { ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_INTERLEAVED); diff --git a/apps/codecs/alac.c b/apps/codecs/alac.c index d65cdb7..13423f4 100644 --- a/apps/codecs/alac.c +++ b/apps/codecs/alac.c @@ -78,7 +78,7 @@ enum codec_status codec_start(struct codec_api* api) while (!*ci->taginfo_ready && !ci->stop_codec) ci->sleep(1); - ci->configure(DSP_SET_FREQUENCY, (long *)(rb->id3->frequency)); + ci->configure(DSP_SWITCH_FREQUENCY, (long *)(rb->id3->frequency)); codec_set_replaygain(rb->id3); stream_create(&input_stream,ci); diff --git a/apps/codecs/flac.c b/apps/codecs/flac.c index 9f2405f..4f5f0b1 100644 --- a/apps/codecs/flac.c +++ b/apps/codecs/flac.c @@ -470,7 +470,7 @@ enum codec_status codec_start(struct codec_api* api) while (!*ci->taginfo_ready && !ci->stop_codec) ci->sleep(1); - ci->configure(DSP_SET_FREQUENCY, (long *)(ci->id3->frequency)); + ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); codec_set_replaygain(ci->id3); if (samplesdone) { diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c index ff6090e..94947a9 100644 --- a/apps/codecs/mpa.c +++ b/apps/codecs/mpa.c @@ -110,7 +110,7 @@ next_track: while (!*ci->taginfo_ready && !ci->stop_codec) ci->sleep(1); - ci->configure(DSP_SET_FREQUENCY, (int *)ci->id3->frequency); + ci->configure(DSP_SWITCH_FREQUENCY, (int *)ci->id3->frequency); current_frequency = ci->id3->frequency; codec_set_replaygain(ci->id3); diff --git a/apps/codecs/mpc.c b/apps/codecs/mpc.c index 821b3ce..ad38185 100644 --- a/apps/codecs/mpc.c +++ b/apps/codecs/mpc.c @@ -121,7 +121,7 @@ next_track: goto done; } frequency = info.sample_freq / 1000; - ci->configure(DSP_SET_FREQUENCY, (long *)(long)info.sample_freq); + ci->configure(DSP_SWITCH_FREQUENCY, (long *)(long)info.sample_freq); /* set playback engine up for correct number of channels */ /* NOTE: current musepack format only allows for stereo files diff --git a/apps/codecs/shorten.c b/apps/codecs/shorten.c index a7fc601..b48a91e 100644 --- a/apps/codecs/shorten.c +++ b/apps/codecs/shorten.c @@ -98,7 +98,7 @@ next_track: } ci->id3->frequency = sc.sample_rate; - ci->configure(DSP_SET_FREQUENCY, (long *)(long)(sc.sample_rate)); + ci->configure(DSP_SWITCH_FREQUENCY, (long *)(long)(sc.sample_rate)); if (sc.sample_rate) { ci->id3->length = (sc.totalsamples / sc.sample_rate) * 1000; diff --git a/apps/codecs/sid.c b/apps/codecs/sid.c index c95e44b..d356da7 100644 --- a/apps/codecs/sid.c +++ b/apps/codecs/sid.c @@ -1267,7 +1267,7 @@ next_track: /* Make use of 44.1khz */ - ci->configure(DSP_SET_FREQUENCY, (long *)44100); + ci->configure(DSP_SWITCH_FREQUENCY, (long *)44100); /* Sample depth is 28 bit host endian */ ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)28); /* Mono output */ diff --git a/apps/codecs/vorbis.c b/apps/codecs/vorbis.c index 0475572..d08cb0e 100644 --- a/apps/codecs/vorbis.c +++ b/apps/codecs/vorbis.c @@ -85,7 +85,7 @@ bool vorbis_set_codec_parameters(OggVorbis_File *vf) return false; } - rb->configure(DSP_SET_FREQUENCY, (int *)rb->id3->frequency); + rb->configure(DSP_SWITCH_FREQUENCY, (int *)rb->id3->frequency); codec_set_replaygain(rb->id3); if (vi->channels == 2) { diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c index ba99b94..9add1f5 100644 --- a/apps/codecs/wav.c +++ b/apps/codecs/wav.c @@ -397,7 +397,7 @@ next_track: goto done; } - ci->configure(DSP_SET_FREQUENCY, (long *)(ci->id3->frequency)); + ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); if (channels == 2) { ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_INTERLEAVED); } else if (channels == 1) { diff --git a/apps/codecs/wavpack.c b/apps/codecs/wavpack.c index de815e6..6528053 100644 --- a/apps/codecs/wavpack.c +++ b/apps/codecs/wavpack.c @@ -74,7 +74,7 @@ enum codec_status codec_start(struct codec_api* api) while (!*ci->taginfo_ready && !ci->stop_codec) ci->sleep(1); - ci->configure(DSP_SET_FREQUENCY, (long *)(ci->id3->frequency)); + ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); codec_set_replaygain(ci->id3); /* Create a decoder instance */ @@ -1055,6 +1055,12 @@ bool dsp_configure(int setting, void *value) dsp->new_gain = true; break; + case DSP_FLUSH: + memset(&resample_data[current_codec], 0, + sizeof (struct resample_data)); + dither_init(); + break; + case DSP_SET_TRACK_GAIN: dsp->track_gain = (long) value; dsp->new_gain = true; @@ -39,6 +39,7 @@ enum { DSP_SET_SAMPLE_DEPTH, DSP_SET_STEREO_MODE, DSP_RESET, + DSP_FLUSH, DSP_SET_TRACK_GAIN, DSP_SET_ALBUM_GAIN, DSP_SET_TRACK_PEAK, diff --git a/apps/playback.c b/apps/playback.c index 2b08a99..90cedc0 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1679,7 +1679,8 @@ static void codec_seek_complete_callback(void) { /* If this is not a seamless seek, clear the buffer */ pcmbuf_play_stop(); - + dsp_configure(DSP_FLUSH, NULL); + /* If playback was not 'deliberately' paused, unpause now */ if (!paused) pcmbuf_pause(false); |