diff options
Diffstat (limited to 'apps/plugins/mpegplayer')
| -rw-r--r-- | apps/plugins/mpegplayer/audio_thread.c | 1 | ||||
| -rw-r--r-- | apps/plugins/mpegplayer/mpegplayer.h | 2 | ||||
| -rw-r--r-- | apps/plugins/mpegplayer/pcm_output.c | 6 |
3 files changed, 8 insertions, 1 deletions
diff --git a/apps/plugins/mpegplayer/audio_thread.c b/apps/plugins/mpegplayer/audio_thread.c index 1c167ea..764ad11 100644 --- a/apps/plugins/mpegplayer/audio_thread.c +++ b/apps/plugins/mpegplayer/audio_thread.c @@ -481,6 +481,7 @@ static void audio_thread(void) init_mad(); td.dsp = rb->dsp_get_config(CODEC_IDX_AUDIO); + rb->dsp_configure(td.dsp, DSP_SET_OUT_FREQUENCY, CLOCK_RATE); #ifdef HAVE_PITCHCONTROL rb->sound_set_pitch(PITCH_SPEED_100); rb->dsp_set_timestretch(PITCH_SPEED_100); diff --git a/apps/plugins/mpegplayer/mpegplayer.h b/apps/plugins/mpegplayer/mpegplayer.h index 32cc7b2..4ddf0ca 100644 --- a/apps/plugins/mpegplayer/mpegplayer.h +++ b/apps/plugins/mpegplayer/mpegplayer.h @@ -44,7 +44,7 @@ #define AUDIOBUF_ALLOC_SIZE (AUDIOBUF_SIZE+AUDIOBUF_GUARD_SIZE) /** PCM buffer **/ -#define CLOCK_RATE NATIVE_FREQUENCY /* Our clock rate in ticks/second (samplerate) */ +#define CLOCK_RATE 44100 /* Our clock rate in ticks/second (samplerate) */ /* Define this as "1" to have a test tone instead of silence clip */ #define SILENCE_TEST_TONE 0 diff --git a/apps/plugins/mpegplayer/pcm_output.c b/apps/plugins/mpegplayer/pcm_output.c index 3af8e91..82e3584 100644 --- a/apps/plugins/mpegplayer/pcm_output.c +++ b/apps/plugins/mpegplayer/pcm_output.c @@ -51,6 +51,8 @@ static uint32_t volatile clock_time IBSS_ATTR; /* Timestamp adjusted */ static int pcm_skipped = 0; static int pcm_underruns = 0; +static unsigned int old_sampr = 0; + /* Small silence clip. ~5.80ms @ 44.1kHz */ static int16_t silence[256*2] ALIGNED_ATTR(4) = { 0 }; @@ -380,9 +382,13 @@ bool pcm_output_init(void) } #endif + old_sampr = rb->mixer_get_frequency(); + rb->mixer_set_frequency(CLOCK_RATE); return true; } void pcm_output_exit(void) { + if (old_sampr != 0) + rb->mixer_set_frequency(old_sampr); } |