CVS: winex/dlls/winmm/winealsa audio.c,1.45,1.46
[email protected] 30 Mar 2007 21:32:42 -0000
Newsgroups
gmane.comp.emulators.winex.cvs
Message-ID
<[email protected] >
Subject: winex/dlls/winmm/winealsa audio.c,1.45,1.46Update of /var/lib/cvsd/cvsroot/winex/dlls/winmm/winealsa
In directory agravaine:/tmp/cvs-serv24478/dlls/winmm/winealsa
Modified Files:
audio.c
Log Message:
Adapted xrun recovery to take the new mmap technique into account...
just in case.
Index: audio.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/winmm/winealsa/audio.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- audio.c 30 Mar 2007 21:32:29 -0000 1.45
+++ audio.c 30 Mar 2007 21:32:40 -0000 1.46
@@ -2049,10 +2049,11 @@
return WOutDev[pdbi->drv->wDevID].hw_params;
}
-static void DSDB_CheckXRUN(IDsDriverBufferImpl* pdbi)
+static BOOL DSDB_CheckXRUN(IDsDriverBufferImpl* pdbi)
{
snd_pcm_t * handle = DSDB_get_handle(pdbi);
snd_pcm_state_t state = snd_pcm_state(handle);
+ BOOL reset = FALSE;
if ( state == SND_PCM_STATE_XRUN )
{
@@ -2060,7 +2061,7 @@
TRACE("xrun occurred\n");
if ( err < 0 )
ERR("recovery from xrun failed, prepare failed: %s\n", snd_strerror(err));
- pdbi->mmap_app_position = 0;
+ reset = TRUE;
}
else if ( state == SND_PCM_STATE_SUSPENDED )
{
@@ -2070,9 +2071,21 @@
err = snd_pcm_prepare(handle);
if (err < 0)
ERR("recovery from suspend failed, prepare failed: %s\n", snd_strerror(err));
- pdbi->mmap_app_position = 0;
+ reset = TRUE;
}
}
+ if (reset) {
+ pdbi->mmap_app_position = 0;
+ if (pdbi->mmap_async_commit) {
+ /* reinitialize mmap_areas_last */
+ snd_pcm_uframes_t frames = 0;
+ snd_pcm_uframes_t offset = 0;
+ int err = snd_pcm_mmap_begin(handle, &pdbi->mmap_areas_last, &offset, &frames);
+ if (err < 0)
+ ERR("mmap_begin failed, reason: %s\n", snd_strerror(err));
+ }
+ }
+ return reset;
}
static void DSDB_MMAPCopy(IDsDriverBufferImpl* pdbi)
@@ -2885,8 +2898,6 @@
{
ICOM_THIS(IDsDriverBufferImpl,iface);
snd_pcm_t * handle = DSDB_get_handle(This);
- snd_pcm_uframes_t frames = 0;
- snd_pcm_uframes_t offset = 0;
int err;
TRACE("(%p)\n",iface);
@@ -2904,6 +2915,8 @@
if (This->mmap_async_commit) {
/* reinitialize mmap_areas_last */
+ snd_pcm_uframes_t frames = 0;
+ snd_pcm_uframes_t offset = 0;
err = snd_pcm_mmap_begin(handle, &This->mmap_areas_last, &offset, &frames);
if (err < 0) {
ERR("mmap_begin failed, reason: %s\n", snd_strerror(err));