cleanup
This commit is contained in:
@@ -50,4 +50,5 @@ FUNC(int, snd_pcm_sw_params_current, (snd_pcm_t *pcm, snd_pcm_sw_params_t *param
|
||||
FUNC(int, snd_pcm_sw_params_get_boundary, (const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val));
|
||||
FUNC(int, snd_pcm_sw_params_get_xfer_align, (const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val));
|
||||
FUNC(int, snd_pcm_sw_params_set_stop_threshold, (snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val));
|
||||
FUNC(int, snd_pcm_sw_params_get_avail_min, (snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val));
|
||||
|
||||
|
||||
@@ -88,6 +88,14 @@ bool Alsa9Buf::SetSWParams()
|
||||
int err = dsnd_pcm_sw_params_get_xfer_align( swparams, &xfer_align );
|
||||
ALSA_ASSERT("dsnd_pcm_sw_params_get_xfer_align");
|
||||
|
||||
snd_pcm_uframes_t avail_min;
|
||||
err = dsnd_pcm_sw_params_get_avail_min( swparams, &avail_min );
|
||||
ALSA_ASSERT("dsnd_pcm_sw_params_get_avail_min");
|
||||
|
||||
/* So far, I havn't seen a case where avail_min > xfer_align. If that happens,
|
||||
* the GetNumFramesToFill will need updating. */
|
||||
ASSERT( avail_min <= xfer_align );
|
||||
|
||||
/* If this fails, we might have bound dsnd_pcm_sw_params_get_xfer_align to
|
||||
* the old SW API. */
|
||||
ASSERT( err <= 0 );
|
||||
|
||||
@@ -285,9 +285,6 @@ bool DSoundBuf::get_output_buf(char **buffer, unsigned *bufsiz, int chunksize)
|
||||
ASSERT(!buffer_locked);
|
||||
|
||||
DWORD cursorstart, cursorend;
|
||||
#if !defined(_XBOX)
|
||||
DWORD junk;
|
||||
#endif
|
||||
|
||||
HRESULT result;
|
||||
|
||||
@@ -353,7 +350,6 @@ bool DSoundBuf::get_output_buf(char **buffer, unsigned *bufsiz, int chunksize)
|
||||
LOG->Trace("underrun %p: %i..%i filled but cursor at %i..%i (missed it by %i) %i/%i",
|
||||
this, first_byte_filled, write_cursor, cursorstart, cursorend,
|
||||
missed_by, buffer_bytes_filled, buffersize);
|
||||
// (cursorend - first_byte_filled + buffersize) % buffersize);
|
||||
|
||||
/* Pretend the space between the play and write cursor is filled
|
||||
* with data, and continue filling from there. */
|
||||
@@ -395,6 +391,7 @@ bool DSoundBuf::get_output_buf(char **buffer, unsigned *bufsiz, int chunksize)
|
||||
#ifdef _XBOX
|
||||
result = buf->Lock(write_cursor, num_bytes_empty, (LPVOID *)buffer, (DWORD *) bufsiz, NULL, NULL, 0);
|
||||
#else
|
||||
DWORD junk;
|
||||
result = buf->Lock(write_cursor, num_bytes_empty, (LPVOID *)buffer, (DWORD *) bufsiz, NULL, &junk, 0);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user