Fix wrong usage of audio_info_t and audio_prinfo_t
This commit is contained in:
parent
62898c85f8
commit
abdfcf2e00
1 changed files with 14 additions and 10 deletions
|
@ -28,15 +28,15 @@ static void* soundcheckthread(void*) {
|
|||
uint16_t out[0x400 * 2];
|
||||
while(1) {
|
||||
bool ready = false;
|
||||
audio_prinfo_t audioInfo;
|
||||
audio_info_t audioInfo;
|
||||
ioctl(sndfp, AUDIO_GETINFO, &audioInfo);
|
||||
int oldeof = audioInfo.eof;
|
||||
int oldeof = audioInfo.play.eof;
|
||||
|
||||
usleep(for_as_long_as_it_seems_we_should);
|
||||
|
||||
while(ready == false) {
|
||||
ioctl(sndfp, AUDIO_GETINFO, &audioInfo);
|
||||
if(audioInfo.eof > oldeof) {
|
||||
if(audioInfo.play.eof > oldeof) {
|
||||
ready = true;
|
||||
}
|
||||
}
|
||||
|
@ -72,13 +72,17 @@ unsigned long SoftwareMixerBackend_Init(void (*callback)(long *stream, size_t fr
|
|||
return 0;
|
||||
}
|
||||
|
||||
audio_prinfo_t audioInfo;
|
||||
audio_info_t audioInfo;
|
||||
ioctl(sndfp, AUDIO_GETINFO, &audioInfo);
|
||||
audioInfo.sample_rate = 48000;
|
||||
audioInfo.channels = 2;
|
||||
audioInfo.precision = 16;
|
||||
audioInfo.encoding = AUDIO_ENCODING_LINEAR;
|
||||
audioInfo.port = AUDIO_SPEAKER;
|
||||
audio_prinfo_t info = audioInfo.play;
|
||||
|
||||
info.sample_rate = 8000;
|
||||
info.channels = 2;
|
||||
info.precision = 8;
|
||||
info.encoding = AUDIO_ENCODING_LINEAR;
|
||||
info.port = AUDIO_SPEAKER;
|
||||
|
||||
audioInfo.play = info;
|
||||
ioctl(sndfp, AUDIO_SETINFO, &audioInfo);
|
||||
|
||||
if(signal(parkSignal, threadPark) == SIG_ERR) {
|
||||
|
@ -94,7 +98,7 @@ unsigned long SoftwareMixerBackend_Init(void (*callback)(long *stream, size_t fr
|
|||
|
||||
pthread_create(&thread, &thread_attr, soundcheckthread, (void*)NULL);
|
||||
|
||||
return 48000; // return the sampling rate
|
||||
return 8000; // return the sampling rate
|
||||
}
|
||||
|
||||
void SoftwareMixerBackend_Deinit(void) {
|
||||
|
|
Loading…
Add table
Reference in a new issue