#include <vlc_cpu.h>
#include <vlc_aout.h>
+#if !defined (__FreeBSD__) && !defined (__FreeBSD_kernel__)
+# define USE_SOFTVOL
+# include "volume.h"
+#endif
+
#define A52_FRAME_NB 1536
struct aout_sys_t
set_subcategory( SUBCAT_AUDIO_AOUT )
add_string ("oss-audio-device", "",
AUDIO_DEV_TEXT, AUDIO_DEV_LONGTEXT, false)
+#ifdef USE_SOFTVOL
+ add_sw_gain ()
+#endif
set_capability( "audio output", 100 )
set_callbacks (Open, Close)
vlc_module_end ()
static void Play (audio_output_t *, block_t *);
static void Pause (audio_output_t *, bool, mtime_t);
static void Flush (audio_output_t *, bool);
+#ifndef USE_SOFTVOL
static int VolumeSync (audio_output_t *);
+#endif
static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
{
vlc_strerror_c(errno));
sys->fd = fd;
+#ifndef USE_SOFTVOL
VolumeSync (aout);
+#else
+ aout_SoftVolumeStart (aout);
+#endif
sys->starting = true;
sys->format = *fmt;
return VLC_SUCCESS;
}
block_Release (block);
+#ifndef USE_SOFTVOL
/* Dumb OSS cannot send any kind of events for this... */
VolumeSync (aout);
+#endif
}
/**
ioctl (fd, SNDCTL_DSP_HALT, NULL);
}
+#ifndef USE_SOFTVOL
static int VolumeSync (audio_output_t *aout)
{
aout_sys_t *sys = aout->sys;
aout_VolumeReport (aout, (float)(level & 0xFF) / 100.f);
return 0;
}
+#endif
/**
* Releases the audio output device.
aout->mute_set = MuteSet;
aout->device_select = DeviceSelect;
+#ifdef USE_SOFTVOL
+ aout_SoftVolumeInit (aout);
+#endif
DevicesEnum (aout);
return VLC_SUCCESS;
}