Commit 3995627d authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

winealsa.drv: Fix compiler warnings and remove deprecated calls.

Fixes wine build on lsb compliant systems and some warnings.
parent 236147b5
......@@ -621,8 +621,6 @@ void ALSA_TraceParameters(snd_pcm_hw_params_t * hw_params, snd_pcm_sw_params_t *
int err;
snd_pcm_format_t format;
snd_pcm_access_t access;
err = snd_pcm_hw_params_get_access(hw_params, &access);
err = snd_pcm_hw_params_get_format(hw_params, &format);
#define X(x) ((x)? "true" : "false")
if (full)
......@@ -640,8 +638,11 @@ void ALSA_TraceParameters(snd_pcm_hw_params_t * hw_params, snd_pcm_sw_params_t *
X(snd_pcm_hw_params_is_joint_duplex(hw_params)));
#undef X
if (access >= 0)
err = snd_pcm_hw_params_get_access(hw_params, &access);
if (err >= 0)
{
TRACE("access=%s\n", snd_pcm_access_name(access));
}
else
{
snd_pcm_access_mask_t * acmask;
......@@ -654,7 +655,8 @@ void ALSA_TraceParameters(snd_pcm_hw_params_t * hw_params, snd_pcm_sw_params_t *
HeapFree( GetProcessHeap(), 0, acmask );
}
if (format >= 0)
err = snd_pcm_hw_params_get_format(hw_params, &format);
if (err >= 0)
{
TRACE("format=%s\n", snd_pcm_format_name(format));
......
......@@ -448,11 +448,10 @@ static int CreateMMAP(IDsCaptureDriverBufferImpl* pdbi)
snd_pcm_sw_params_set_silence_threshold(pcm, sw_params, INT_MAX);
snd_pcm_sw_params_set_silence_size(pcm, sw_params, 0);
snd_pcm_sw_params_set_avail_min(pcm, sw_params, 0);
snd_pcm_sw_params_set_xrun_mode(pcm, sw_params, SND_PCM_XRUN_NONE);
err = snd_pcm_sw_params(pcm, sw_params);
avail = snd_pcm_avail_update(pcm);
if (avail < 0)
if ((snd_pcm_sframes_t)avail < 0)
{
ERR("No buffer is available: %s.\n", snd_strerror(avail));
return DSERR_GENERIC;
......
......@@ -207,14 +207,13 @@ static int DSDB_CreateMMAP(IDsDriverBufferImpl* pdbi)
snd_pcm_sw_params_set_start_threshold(pcm, sw_params, 0);
snd_pcm_sw_params_get_boundary(sw_params, &boundary);
snd_pcm_sw_params_set_stop_threshold(pcm, sw_params, boundary);
snd_pcm_sw_params_set_silence_threshold(pcm, sw_params, INT_MAX);
snd_pcm_sw_params_set_silence_threshold(pcm, sw_params, boundary);
snd_pcm_sw_params_set_silence_size(pcm, sw_params, 0);
snd_pcm_sw_params_set_avail_min(pcm, sw_params, 0);
snd_pcm_sw_params_set_xrun_mode(pcm, sw_params, SND_PCM_XRUN_NONE);
err = snd_pcm_sw_params(pcm, sw_params);
avail = snd_pcm_avail_update(pcm);
if (avail < 0)
if ((snd_pcm_sframes_t)avail < 0)
{
ERR("No buffer is available: %s.\n", snd_strerror(avail));
return DSERR_GENERIC;
......
......@@ -483,7 +483,6 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
EXIT_ON_ERROR( snd_pcm_sw_params_set_start_threshold(pcm, sw_params, 1), MMSYSERR_ERROR, "unable to set start threshold");
EXIT_ON_ERROR( snd_pcm_sw_params_set_silence_size(pcm, sw_params, 0), MMSYSERR_ERROR, "unable to set silence size");
EXIT_ON_ERROR( snd_pcm_sw_params_set_avail_min(pcm, sw_params, period_size), MMSYSERR_ERROR, "unable to set avail min");
EXIT_ON_ERROR( snd_pcm_sw_params_set_xfer_align(pcm, sw_params, 1), MMSYSERR_ERROR, "unable to set xfer align");
EXIT_ON_ERROR( snd_pcm_sw_params_set_silence_threshold(pcm, sw_params, 0), MMSYSERR_ERROR, "unable to set silence threshold");
EXIT_ON_ERROR( snd_pcm_sw_params(pcm, sw_params), MMSYSERR_ERROR, "unable to set sw params for playback");
#undef EXIT_ON_ERROR
......
......@@ -537,6 +537,7 @@ static DWORD CALLBACK wodPlayer(LPVOID pmt)
dwNextFeedTime = dwNextNotifyTime = INFINITE;
}
}
return 0;
}
/**************************************************************************
......@@ -574,6 +575,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
unsigned int period_time = 10000;
snd_pcm_uframes_t buffer_size;
snd_pcm_uframes_t period_size;
snd_pcm_uframes_t boundary;
int flags;
int err=0;
int dir=0;
......@@ -756,12 +758,13 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
err = snd_pcm_hw_params_get_buffer_size(hw_params, &buffer_size);
snd_pcm_sw_params_current(pcm, sw_params);
snd_pcm_sw_params_get_boundary(sw_params, &boundary);
EXIT_ON_ERROR( snd_pcm_sw_params_set_start_threshold(pcm, sw_params, 1), MMSYSERR_ERROR, "unable to set start threshold");
EXIT_ON_ERROR( snd_pcm_sw_params_set_silence_size(pcm, sw_params, 0), MMSYSERR_ERROR, "unable to set silence size");
EXIT_ON_ERROR( snd_pcm_sw_params_set_avail_min(pcm, sw_params, period_size), MMSYSERR_ERROR, "unable to set avail min");
EXIT_ON_ERROR( snd_pcm_sw_params_set_xfer_align(pcm, sw_params, 1), MMSYSERR_ERROR, "unable to set xfer align");
EXIT_ON_ERROR( snd_pcm_sw_params_set_silence_threshold(pcm, sw_params, 0), MMSYSERR_ERROR, "unable to set silence threshold");
EXIT_ON_ERROR( snd_pcm_sw_params_set_xrun_mode(pcm, sw_params, SND_PCM_XRUN_NONE), MMSYSERR_ERROR, "unable to set xrun mode");
EXIT_ON_ERROR( snd_pcm_sw_params_set_stop_threshold(pcm, sw_params, boundary), MMSYSERR_ERROR, "unable to set xrun mode");
EXIT_ON_ERROR( snd_pcm_sw_params(pcm, sw_params), MMSYSERR_ERROR, "unable to set sw params for playback");
#undef EXIT_ON_ERROR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment