Fix for shorten bug at 48000 output rate.
parent
2659c1905c
commit
0be36644a6
|
@ -1,6 +1,6 @@
|
|||
<html>
|
||||
<body style="text-align:center;">
|
||||
Cog is dedicated to snacos, the ungodly combination of snacks and tacos.
|
||||
Cog is brought to you by the letter Q and the number 14.
|
||||
<br /><br />
|
||||
This program has been made possible through contributions from users like you.
|
||||
</body>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
decoder->open([[url path] UTF8String], true);
|
||||
|
||||
bufferSize = decoder->shn_get_buffer_block_size(512);
|
||||
bufferSize = decoder->shn_get_buffer_block_size(NUM_DEFAULT_BUFFER_BLOCKS);
|
||||
|
||||
decoder->file_info(NULL, &channels, &frequency, NULL, &bitsPerSample, NULL);
|
||||
|
||||
|
@ -47,7 +47,8 @@
|
|||
|
||||
totalRead = 0;
|
||||
|
||||
while (totalRead < size) {
|
||||
//For some reason the busy loop is causing pops when output is set to 48000. Probably CPU starvation, since the SHN decoder seems to use a multithreaded approach.
|
||||
// while (totalRead < size) {
|
||||
amountToRead = size - totalRead;
|
||||
if (amountToRead > bufferSize) {
|
||||
amountToRead = bufferSize;
|
||||
|
@ -55,15 +56,16 @@
|
|||
|
||||
do
|
||||
{
|
||||
amountRead = decoder->read(((char *)buf) + totalRead, amountToRead);
|
||||
} while(amountRead == -1);
|
||||
amountRead = decoder->read(buf, amountToRead);
|
||||
} while(amountRead == -1 && totalRead == 0);
|
||||
|
||||
if (amountRead <= 0) {
|
||||
return totalRead;
|
||||
}
|
||||
// if (amountRead <= 0) {
|
||||
// return totalRead;
|
||||
// }
|
||||
|
||||
totalRead += amountRead;
|
||||
}
|
||||
// buf = (void *)((char *)buf + amountRead);
|
||||
// }
|
||||
|
||||
return totalRead;
|
||||
}
|
||||
|
|
7
TODO
7
TODO
|
@ -0,0 +1,7 @@
|
|||
Bug fixes:
|
||||
Short files: http://sbooth.org/forums/viewtopic.php?p=4304
|
||||
Broken MP3: http://sbooth.org/forums/viewtopic.php?t=1103
|
||||
Shorten files: http://sbooth.org/forums/viewtopic.php?p=4305
|
||||
Windows M3U paths: http://sbooth.org/forums/viewtopic.php?t=1209
|
||||
Playlist display: http://sbooth.org/forums/viewtopic.php?t=1050
|
||||
|
Loading…
Reference in New Issue