summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/mpa.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c
index c916aefcaa..e81d8d96c0 100644
--- a/apps/codecs/mpa.c
+++ b/apps/codecs/mpa.c
@@ -25,8 +25,7 @@
25 25
26CODEC_HEADER 26CODEC_HEADER
27 27
28#if (CONFIG_CPU == PP5024 || CONFIG_CPU == PP5022 || CONFIG_CPU == PP5020 \ 28#if defined(CPU_PP) && !defined(MPEGPLAYER)
29 || CONFIG_CPU == PP5002) && !defined(MPEGPLAYER)
30#define MPA_SYNTH_ON_COP 29#define MPA_SYNTH_ON_COP
31#endif 30#endif
32 31
@@ -64,8 +63,12 @@ void init_mad(void)
64 ci->memset(&frame, 0, sizeof(struct mad_frame)); 63 ci->memset(&frame, 0, sizeof(struct mad_frame));
65 ci->memset(&synth, 0, sizeof(struct mad_synth)); 64 ci->memset(&synth, 0, sizeof(struct mad_synth));
66 65
66 ci->memset(&sbsample, 0, sizeof(sbsample));
67
67#ifdef MPA_SYNTH_ON_COP 68#ifdef MPA_SYNTH_ON_COP
68 frame.sbsample_prev = &sbsample_prev; 69 frame.sbsample_prev = &sbsample_prev;
70 ci->memset(&sbsample_prev, 0, sizeof(sbsample_prev));
71 synth_running=0;
69#else 72#else
70 frame.sbsample_prev = &sbsample; 73 frame.sbsample_prev = &sbsample;
71#endif 74#endif
@@ -358,10 +361,15 @@ next_track:
358 ci->yield(); 361 ci->yield();
359 if (ci->stop_codec || ci->new_track) 362 if (ci->stop_codec || ci->new_track)
360 break; 363 break;
361 364
362 if (ci->seek_time) { 365 if (ci->seek_time) {
363 int newpos; 366 int newpos;
364 367
368#ifdef MPA_SYNTH_ON_COP
369 /*make sure the synth thread is idle before seeking*/
370 if(synth_running)
371 mad_synth_thread_wait_pcm();
372#endif
365 samplesdone = ((int64_t)(ci->seek_time-1))*current_frequency/1000; 373 samplesdone = ((int64_t)(ci->seek_time-1))*current_frequency/1000;
366 374
367 if (ci->seek_time-1 == 0) { 375 if (ci->seek_time-1 == 0) {