diff options
| author | Nils Wallménius <nils@rockbox.org> | 2007-09-29 16:06:16 +0000 |
|---|---|---|
| committer | Nils Wallménius <nils@rockbox.org> | 2007-09-29 16:06:16 +0000 |
| commit | c6c7b73a15ac72a4b24041a7a595cb0bc3087bd2 (patch) | |
| tree | 1287c652074a4dc8a88aa5c0aea4c1f5ac60df20 /apps/plugins | |
| parent | 2bee0b719c06fa302d0537b2b373023583afd248 (diff) | |
| download | rockbox-c6c7b73a15ac72a4b24041a7a595cb0bc3087bd2.zip rockbox-c6c7b73a15ac72a4b24041a7a595cb0bc3087bd2.tar.gz rockbox-c6c7b73a15ac72a4b24041a7a595cb0bc3087bd2.tar.bz2 rockbox-c6c7b73a15ac72a4b24041a7a595cb0bc3087bd2.tar.xz | |
Fix bug that caused only half the output buffer to be used, gives a quite nice speedup on coldifre, clean up some commented out #ifdefs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14904 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/midi/midiplay.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/plugins/midi/midiplay.c b/apps/plugins/midi/midiplay.c index 0f79301..52a5388 100644 --- a/apps/plugins/midi/midiplay.c +++ b/apps/plugins/midi/midiplay.c @@ -145,7 +145,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) bool swap=0; bool lastswap=1; -inline void synthbuf(void) +static inline void synthbuf(void) { int32_t *outptr; register int i; @@ -161,7 +161,7 @@ inline void synthbuf(void) outptr=gmbuf; #endif - for(i=0; i<BUF_SIZE/2; i++) + for(i=0; i<BUF_SIZE; i++) { synthSample(&synthtemp[0], &synthtemp[1]); currentSample++; @@ -187,7 +187,7 @@ void get_more(unsigned char** start, size_t* size) synthbuf(); // For some reason midiplayer crashes when an update is forced #endif - *size = BUF_SIZE*sizeof(short); + *size = sizeof(gmbuf)/NBUF; #ifndef SYNC *start = (unsigned char*)((swap ? gmbuf : gmbuf + BUF_SIZE)); swap=!swap; @@ -213,7 +213,6 @@ int midimain(void * filename) ROCKBOX_DIR "/patchset/drums.cfg") == -1) return -1; -//#ifndef SIMULATOR rb->pcm_play_stop(); #if INPUT_SRC_CAPS != 0 /* Select playback */ @@ -221,7 +220,6 @@ int midimain(void * filename) rb->audio_set_output_source(AUDIO_SRC_PLAYBACK); #endif rb->pcm_set_frequency(SAMPLE_RATE); // 44100 22050 11025 -//#endif /* * tick() will do one MIDI clock tick. Then, there's a loop here that @@ -252,9 +250,7 @@ int midimain(void * filename) } while(notesUsed == 0); synthbuf(); -//#ifndef SIMULATOR rb->pcm_play_data(&get_more, NULL, 0); -//#endif int vol=0; |