diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2005-06-10 17:33:16 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2005-06-10 17:33:16 +0000 |
| commit | d30f1100ec8d74f3c187271590b03d589ad4b7dc (patch) | |
| tree | d7730bbc4c13073ae9bd5ca7b756f7238d7dac99 /apps/plugins/codecflac.c | |
| parent | 68b9acd7de3f92e167146b002e3e782cfca924cb (diff) | |
| download | rockbox-d30f1100ec8d74f3c187271590b03d589ad4b7dc.zip rockbox-d30f1100ec8d74f3c187271590b03d589ad4b7dc.tar.gz rockbox-d30f1100ec8d74f3c187271590b03d589ad4b7dc.tar.bz2 rockbox-d30f1100ec8d74f3c187271590b03d589ad4b7dc.tar.xz | |
Much better UI performance and buffering times for MP3 and FLAC.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6653 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/codecflac.c')
| -rw-r--r-- | apps/plugins/codecflac.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/plugins/codecflac.c b/apps/plugins/codecflac.c index d577006..8d0653e 100644 --- a/apps/plugins/codecflac.c +++ b/apps/plugins/codecflac.c @@ -57,6 +57,7 @@ FLAC__StreamDecoderWriteStatus flac_write_handler(const FLAC__SeekableStreamDeco unsigned int c_samp, c_chan, d_samp; uint32_t data_size = frame->header.blocksize * frame->header.channels * 2; /* Assume 16-bit words */ uint32_t samples = frame->header.blocksize; + int yieldcounter = 0; if (samples*frame->header.channels > (FLAC_MAX_SUPPORTED_BLOCKSIZE*FLAC_MAX_SUPPORTED_CHANNELS)) { @@ -70,6 +71,10 @@ FLAC__StreamDecoderWriteStatus flac_write_handler(const FLAC__SeekableStreamDeco for(c_chan = 0; c_chan < frame->header.channels; c_chan++, d_samp++) { pcmbuf[d_samp*2] = (buf[c_chan][c_samp]&0xff00)>>8; pcmbuf[(d_samp*2)+1] = buf[c_chan][c_samp]&0xff; + if (yieldcounter++ == 100) { + rb->yield(); + yieldcounter = 0; + } } } |