Welcome to the Rockbox Technical Forums!
unsigned char dspbuffer[BUF_SIZE * 2 * 2];static int dspbuffer_count = BUF_SIZE ;static void get_more(const void** start, size_t* size){#ifndef SYNC if (lastswap != swap) { //DEBUGF("Buffer miss!"); }#else synthbuf();#endif /* process dsp */ src.remcount = BUF_SIZE; src.pin[0] = gmbuf; src.pin[1] = gmbuf; src.proc_mask = 0; struct dsp_buffer dst; dst.remcount = 0; dst.p16out = (int16_t *)dspbuffer; dst.bufcount = dspbuffer_count; while (1) { int old_remcount = dst.remcount; rb->dsp_process(dsp, &src, &dst); if (dst.bufcount <= 0 || (src.remcount <= 0 && dst.remcount <= old_remcount)) { /* Dest is full or no input left and DSP purged */ break; } } //*size = BUF_SIZE; *size = dst.remcount >> 1;#ifndef SYNC *start = swap ? gmbuf : gmbuf + BUF_SIZE; swap = !swap;#else //*start = gmbuf; *start = dspbuffer;#endif}
/* configure dsp */ dsp = rb->dsp_get_config(CODEC_IDX_AUDIO); rb->dsp_configure(dsp, DSP_RESET, 0); rb->dsp_configure(dsp, DSP_FLUSH, 0); rb->dsp_configure(dsp, DSP_SWITCH_FREQUENCY, streamfile->sample_rate); rb->dsp_configure(dsp, DSP_SET_STEREO_MODE, streamfile->channels == 1 ? STEREO_MONO : STEREO_NONINTERLEAVED);
static inline void synthbuf(void){ char *outptr;#ifndef SYNC if (lastswap == swap) return; lastswap = swap; outptr = (swap ? gmbuf : gmbuf + BUF_SIZE);#else outptr = gmbuf;#endif /* have we finished decoding? */ current_sample += BUF_SIZE / (channels << 1); if( current_sample >= total_samples ) { exit_flag = 1; return; } render_vgmstream((sample *)gmbuf, BUF_SIZE / (channels << 1), streamfile); // playingtime += (BUF_SIZE / (channels << 1)) / 44.1;}
Page created in 0.061 seconds with 21 queries.