Fix Vorbis playback
Tested with a stereo OGG Vorbis file only. Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
This commit is contained in:
@@ -91,7 +91,7 @@ int getFileType(const char *file)
|
||||
else if(isFlac(file) == 0)
|
||||
file_type = FILE_TYPE_FLAC;
|
||||
else if(isVorbis(file) == 0)
|
||||
file_type = FILE_TYPE_OGG;
|
||||
file_type = FILE_TYPE_VORBIS;
|
||||
else
|
||||
{
|
||||
errno = FILE_NOT_SUPPORTED;
|
||||
@@ -163,8 +163,9 @@ void playFile(void* infoIn)
|
||||
setMp3(&decoder);
|
||||
break;
|
||||
|
||||
case FILE_TYPE_OGG:
|
||||
case FILE_TYPE_VORBIS:
|
||||
setVorbis(&decoder);
|
||||
break;
|
||||
|
||||
default:
|
||||
goto err;
|
||||
@@ -184,6 +185,12 @@ void playFile(void* infoIn)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if((*decoder.channels)() > 2 || (*decoder.channels)() < 1)
|
||||
{
|
||||
errno = UNSUPPORTED_CHANNELS;
|
||||
goto err;
|
||||
}
|
||||
|
||||
buffer1 = linearAlloc(decoder.buffSize * sizeof(int16_t));
|
||||
buffer2 = linearAlloc(decoder.buffSize * sizeof(int16_t));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user