Fix types in MP3 decoder

Using casts as a work around, and fixed type of one variable.

Signed-off-by: Mahyar Koshkouei <deltabeard@users.noreply.github.com>
This commit is contained in:
Mahyar Koshkouei
2017-01-12 11:41:53 +00:00
parent 42b3d50a16
commit 1c2203ffd0

View File

@@ -52,7 +52,7 @@ int initMp3(const char* file)
} }
if(mpg123_open(mh, file) != MPG123_OK || if(mpg123_open(mh, file) != MPG123_OK ||
mpg123_getformat(mh, &rate, &channels, &encoding) != MPG123_OK) mpg123_getformat(mh, (long *) &rate, (int *) &channels, &encoding) != MPG123_OK)
{ {
//printf("Trouble with mpg123: %s\n", mpg123_strerror(mh)); //printf("Trouble with mpg123: %s\n", mpg123_strerror(mh));
return -1; return -1;
@@ -102,7 +102,7 @@ uint8_t channelMp3(void)
*/ */
uint64_t decodeMp3(void* buffer) uint64_t decodeMp3(void* buffer)
{ {
int done = 0; size_t done = 0;
mpg123_read(mh, buffer, *buffSize, &done); mpg123_read(mh, buffer, *buffSize, &done);
return done / (sizeof(int16_t)); return done / (sizeof(int16_t));
} }