Changeset 19495


Ignore:
Timestamp:
Jul 31, 2002, 3:51:21 PM (23 years ago)
Author:
sandervl
Message:

Custom build function SetFixedWaveBufferSize added

Location:
tags/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/include/custombuild.h

    r19477 r19495  
    8888void WIN32API DisableWaveAudio();
    8989
     90//Call to tell winmm to expect simple fixed size buffers, so
     91//it doesn't have to use very small DART buffers; this will
     92//only work in very specific cases; it is not a good general
     93//purpose solution)
     94void WIN32API SetFixedWaveBufferSize();
     95
    9096//Override shared semaphore name used to synchronize global window handle
    9197//array access (to avoid name clash with Odin)
  • TabularUnified tags/trunk/src/winmm/waveoutdart.cpp

    r19126 r19495  
    1 /* $Id: waveoutdart.cpp,v 1.10 2002-06-05 11:44:11 sandervl Exp $ */
     1/* $Id: waveoutdart.cpp,v 1.11 2002-07-31 13:51:21 sandervl Exp $ */
    22
    33/*
     
    1111 * Note:
    1212 * 2000/11/24 PH MCI_MIXSETUP_PARMS->pMixWrite does alter FS: selector!
     13 * TODO: mulaw, alaw & adpcm
    1314 *
    1415 */
     
    5051LONG APIENTRY WaveOutHandler(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, ULONG ulFlags);
    5152
    52 //TODO: mulaw, alaw & adpcm
     53static BOOL fFixedWaveBufferSize = FALSE;
     54
     55/******************************************************************************/
     56//Call to tell winmm to expect simple fixed size buffers, so
     57//it doesn't have to use very small DART buffers; this will
     58//only work in very specific cases; it is not a good general
     59//purpose solution)
     60/******************************************************************************/
     61void WIN32API SetFixedWaveBufferSize()
     62{
     63    fFixedWaveBufferSize = TRUE;
     64}
    5365/******************************************************************************/
    5466/******************************************************************************/
     
    194206
    195207#if 1
    196         int consumerate = getAvgBytesPerSecond();
    197         int minbufsize = consumerate/32;
    198 
    199         ulBufSize = pwh->dwBufferLength/2;
    200         if(ulBufSize > minbufsize) {
    201             dprintf(("set buffer size to %d bytes (org size = %d)", minbufsize, pwh->dwBufferLength));
    202             ulBufSize = minbufsize;
    203         }
     208        if(fFixedWaveBufferSize == FALSE)
     209        {//by default we need to select a small enough buffer to be able to
     210         //signal buffer completion in time
     211            int consumerate = getAvgBytesPerSecond();
     212            int minbufsize = consumerate/32;
     213
     214            ulBufSize = pwh->dwBufferLength/2;
     215            if(ulBufSize > minbufsize) {
     216                dprintf(("set buffer size to %d bytes (org size = %d)", minbufsize, pwh->dwBufferLength));
     217                ulBufSize = minbufsize;
     218            }
     219        }
     220        else ulBufSize = pwh->dwBufferLength;
    204221#else
    205222        if(pwh->dwBufferLength >= 512 && pwh->dwBufferLength <= 1024)
Note: See TracChangeset for help on using the changeset viewer.