Changeset 2495


Ignore:
Timestamp:
Mar 10, 2009 12:05:23 PM (16 years ago)
Author:
bennylp
Message:

Attempt to reduce burst in wmme_dev by limiting the number of AddBuffer? calls. It does not seem to affect the burst much as it seem to have come from the device/driver itself

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/wmme_dev.c

    r2494 r2495  
    674674    pj_status_t status = PJ_SUCCESS; 
    675675    static unsigned rec_cnt, play_cnt; 
     676    enum { MAX_BURST = 1 }; 
    676677 
    677678    rec_cnt = play_cnt = 0; 
     
    707708        pjmedia_dir signalled_dir; 
    708709 
    709         /* Swap */ 
     710        /* Swap hWaveIn and hWaveOut to get equal opportunity for both */ 
    710711        if (eventCount==3) { 
    711712            HANDLE hTemp = events[2]; 
     
    740741        { 
    741742            struct wmme_channel *wmme_strm = &strm->play_strm; 
     743            unsigned burst; 
    742744 
    743745            status = PJ_SUCCESS; 
     
    748750             */ 
    749751 
    750             while (wmme_strm->WaveHdr[wmme_strm->dwBufIdx].dwFlags & WHDR_DONE) 
     752            for (burst=0; burst<MAX_BURST && 
     753                 (wmme_strm->WaveHdr[wmme_strm->dwBufIdx].dwFlags & WHDR_DONE); 
     754                 ++burst) 
    751755            { 
    752756                void *buffer = wmme_strm->WaveHdr[wmme_strm->dwBufIdx].lpData; 
     
    829833                wmme_strm->timestamp.u64 += strm->param.samples_per_frame / 
    830834                                            strm->param.channel_count; 
    831             } 
     835            } /* for */ 
    832836        } 
    833837        else 
    834838        { 
    835839            struct wmme_channel *wmme_strm = &strm->rec_strm; 
     840            unsigned burst; 
    836841            MMRESULT mr = MMSYSERR_NOERROR; 
    837842            status = PJ_SUCCESS; 
     
    865870#endif 
    866871 
    867             while (wmme_strm->WaveHdr[wmme_strm->dwBufIdx].dwFlags & WHDR_DONE) 
     872            for (burst=0; burst<MAX_BURST && 
     873                 (wmme_strm->WaveHdr[wmme_strm->dwBufIdx].dwFlags & WHDR_DONE); 
     874                 ++burst) 
    868875            { 
    869876                char* buffer = (char*) 
     
    935942                wmme_strm->timestamp.u64 += strm->param.samples_per_frame / 
    936943                                            strm->param.channel_count; 
    937             } 
     944            } /* for */ 
    938945        } 
    939946    } 
Note: See TracChangeset for help on using the changeset viewer.