Use dynamic buffer size for mp3 again

Additionally removed the old MP3 code, saving a massive 1KB from the
binary!

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
Mahyar Koshkouei
2017-01-12 11:30:07 +00:00
parent a1cd5363db
commit 42b3d50a16
3 changed files with 23 additions and 172 deletions

View File

@@ -38,8 +38,6 @@ int playFile(const char* file)
case FILE_TYPE_MP3:
setMp3(&decoder);
break;
//playMp3(file);
//return 0;
default:
printf("Unsupported File type.\n");
@@ -52,10 +50,6 @@ int playFile(const char* file)
goto out;
}
printf("Here: %d\n", __LINE__);
buffer1 = linearAlloc(decoder.buffSize * sizeof(int16_t));
buffer2 = linearAlloc(decoder.buffSize * sizeof(int16_t));
printf("Here: %d\n", __LINE__);
if((ret = (*decoder.init)(file)) != 0)
{
@@ -64,6 +58,10 @@ int playFile(const char* file)
}
printf("Here: %d\n", __LINE__);
buffer1 = linearAlloc(decoder.buffSize * sizeof(int16_t));
buffer2 = linearAlloc(decoder.buffSize * sizeof(int16_t));
printf("Here: %d\n", __LINE__);
#ifdef DEBUG
printf("\nRate: %lu\tChan: %d\n", (*decoder.rate)(), (*decoder.channels)());