summaryrefslogtreecommitdiff
path: root/apps/plugins/codecflac.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-06-10 17:33:16 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-06-10 17:33:16 +0000
commitd30f1100ec8d74f3c187271590b03d589ad4b7dc (patch)
treed7730bbc4c13073ae9bd5ca7b756f7238d7dac99 /apps/plugins/codecflac.c
parent68b9acd7de3f92e167146b002e3e782cfca924cb (diff)
downloadrockbox-d30f1100ec8d74f3c187271590b03d589ad4b7dc.tar.gz
rockbox-d30f1100ec8d74f3c187271590b03d589ad4b7dc.zip
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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/plugins/codecflac.c b/apps/plugins/codecflac.c
index d577006440..8d0653e364 100644
--- a/apps/plugins/codecflac.c
+++ b/apps/plugins/codecflac.c
@@ -57,6 +57,7 @@ FLAC__StreamDecoderWriteStatus flac_write_handler(const FLAC__SeekableStreamDeco
57 unsigned int c_samp, c_chan, d_samp; 57 unsigned int c_samp, c_chan, d_samp;
58 uint32_t data_size = frame->header.blocksize * frame->header.channels * 2; /* Assume 16-bit words */ 58 uint32_t data_size = frame->header.blocksize * frame->header.channels * 2; /* Assume 16-bit words */
59 uint32_t samples = frame->header.blocksize; 59 uint32_t samples = frame->header.blocksize;
60 int yieldcounter = 0;
60 61
61 62
62 if (samples*frame->header.channels > (FLAC_MAX_SUPPORTED_BLOCKSIZE*FLAC_MAX_SUPPORTED_CHANNELS)) { 63 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
70 for(c_chan = 0; c_chan < frame->header.channels; c_chan++, d_samp++) { 71 for(c_chan = 0; c_chan < frame->header.channels; c_chan++, d_samp++) {
71 pcmbuf[d_samp*2] = (buf[c_chan][c_samp]&0xff00)>>8; 72 pcmbuf[d_samp*2] = (buf[c_chan][c_samp]&0xff00)>>8;
72 pcmbuf[(d_samp*2)+1] = buf[c_chan][c_samp]&0xff; 73 pcmbuf[(d_samp*2)+1] = buf[c_chan][c_samp]&0xff;
74 if (yieldcounter++ == 100) {
75 rb->yield();
76 yieldcounter = 0;
77 }
73 } 78 }
74 } 79 }
75 80