summaryrefslogtreecommitdiff
path: root/apps/plugins/codecflac.c
diff options
context:
space:
mode:
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