Use type long for delay as it corresp[onds with the alsa type used
This commit is contained in:
@@ -32,7 +32,7 @@ typedef struct {
|
||||
// almost certainly wrong if the buffer is empty, so put silent buffers into it to make it busy.
|
||||
// will change dynamically, so keep watching it. Implemented in ALSA only.
|
||||
// returns -1 if there's a problem
|
||||
int32_t (*delay)();
|
||||
long (*delay)(); // snd_pcm_sframes_t is a signed long
|
||||
|
||||
// may be NULL, in which case soft volume is applied
|
||||
void (*volume)(double vol);
|
||||
|
||||
+3
-2
@@ -42,7 +42,7 @@ static void start(int sample_rate);
|
||||
static void play(short buf[], int samples);
|
||||
static void stop(void);
|
||||
static void flush(void);
|
||||
static int32_t delay(void);
|
||||
static long delay(void);
|
||||
static void volume(double vol);
|
||||
static void linear_volume(double vol);
|
||||
static void parameters(audio_parameters *info);
|
||||
@@ -413,13 +413,14 @@ static void start(int sample_rate) {
|
||||
desired_sample_rate = sample_rate; // must be a variable
|
||||
}
|
||||
|
||||
static int32_t delay() {
|
||||
static long delay() {
|
||||
// debug(3,"audio_alsa delay called.");
|
||||
if (alsa_handle == NULL) {
|
||||
return 0;
|
||||
} else {
|
||||
pthread_mutex_lock(&alsa_mutex);
|
||||
snd_pcm_sframes_t current_avail, current_delay = 0;
|
||||
//snd_pcm_sframes_t is a signed long -- hence the return of a "long"
|
||||
int derr, ignore;
|
||||
if (snd_pcm_state(alsa_handle) == SND_PCM_STATE_RUNNING) {
|
||||
// derr = snd_pcm_avail_delay(alsa_handle, ¤t_avail, ¤t_delay);
|
||||
|
||||
Reference in New Issue
Block a user