macOS: disable OSS backend cleanly and fix build/link errors

macOS has no OSS (/dev/dsp) support, but dsd-fme currently compiles and links OSS code unconditionally, leading to build and link failures.

This PR:

* disables OSS backend cleanly on macOS

* provides a no-op openOSSOutput() stub to satisfy callers

* guards OSS-specific headers and ioctl usage

* preserves existing behavior on Linux/OSS platforms

This allows dsd-fme to build and run correctly on macOS using PulseAudio/CoreAudio paths.
This commit is contained in:
Benjamin Coriou
2025-12-31 15:03:37 +01:00
parent abf28593b1
commit 83d7460a0b
4 changed files with 32 additions and 3 deletions

View File

@@ -189,6 +189,14 @@ void parse_pulse_output_string (dsd_opts * opts, char * input)
}
}
#ifdef __APPLE__
// macOS does not support OSS (/dev/dsp).
// Provide a stub so callers can link while using Pulse/CoreAudio backends.
void openOSSOutput(dsd_opts *opts)
{
(void)opts;
}
#else
void openOSSOutput (dsd_opts * opts)
{
int fmt;
@@ -207,6 +215,7 @@ void openOSSOutput (dsd_opts * opts)
exit(1);
}
fmt = 0;
if (ioctl (opts->audio_out_fd, SNDCTL_DSP_RESET) < 0)
{
@@ -303,6 +312,7 @@ void openOSSOutput (dsd_opts * opts)
}
}
}
#endif
void
processAudio (dsd_opts * opts, dsd_state * state)