mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
Merge pull request #8768 from niacat/audioio-portability
audioio: Improve the portability of the driver to illumos.
This commit is contained in:
commit
948c242922
@ -47,6 +47,8 @@ static void *audioio_init(const char *device, unsigned rate, unsigned latency,
|
|||||||
|
|
||||||
#ifdef AUMODE_PLAY_ALL
|
#ifdef AUMODE_PLAY_ALL
|
||||||
info.mode = AUMODE_PLAY_ALL;
|
info.mode = AUMODE_PLAY_ALL;
|
||||||
|
#elif defined(AUMODE_PLAY)
|
||||||
|
info.mode = AUMODE_PLAY;
|
||||||
#endif
|
#endif
|
||||||
info.play.sample_rate = rate;
|
info.play.sample_rate = rate;
|
||||||
info.play.channels = 2;
|
info.play.channels = 2;
|
||||||
@ -104,8 +106,10 @@ static bool audioio_stop(void *data)
|
|||||||
struct audio_info info;
|
struct audio_info info;
|
||||||
int *fd = (int*)data;
|
int *fd = (int*)data;
|
||||||
|
|
||||||
|
#ifdef AUDIO_FLUSH
|
||||||
if (ioctl(*fd, AUDIO_FLUSH, NULL) < 0)
|
if (ioctl(*fd, AUDIO_FLUSH, NULL) < 0)
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ioctl(*fd, AUDIO_GETINFO, &info) < 0)
|
if (ioctl(*fd, AUDIO_GETINFO, &info) < 0)
|
||||||
return false;
|
return false;
|
||||||
@ -120,8 +124,10 @@ static bool audioio_start(void *data, bool is_shutdown)
|
|||||||
struct audio_info info;
|
struct audio_info info;
|
||||||
int *fd = (int*)data;
|
int *fd = (int*)data;
|
||||||
|
|
||||||
|
#ifdef AUDIO_FLUSH
|
||||||
if (ioctl(*fd, AUDIO_FLUSH, NULL) < 0)
|
if (ioctl(*fd, AUDIO_FLUSH, NULL) < 0)
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ioctl(*fd, AUDIO_GETINFO, &info) < 0)
|
if (ioctl(*fd, AUDIO_GETINFO, &info) < 0)
|
||||||
return false;
|
return false;
|
||||||
@ -159,7 +165,9 @@ static void audioio_free(void *data)
|
|||||||
{
|
{
|
||||||
int *fd = (int*)data;
|
int *fd = (int*)data;
|
||||||
|
|
||||||
|
#ifdef AUDIO_FLUSH
|
||||||
(void)ioctl(*fd, AUDIO_FLUSH, NULL);
|
(void)ioctl(*fd, AUDIO_FLUSH, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
close(*fd);
|
close(*fd);
|
||||||
free(fd);
|
free(fd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user