Changeset 1638


Ignore:
Timestamp:
Dec 27, 2007 7:18:35 AM (16 years ago)
Author:
bennylp
Message:

Handle the case when PortAudio? returns negative sound device count in pasound.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/pasound.c

    r1486 r1638  
    236236PJ_DEF(int) pjmedia_snd_get_dev_count(void) 
    237237{ 
    238     return Pa_GetDeviceCount(); 
     238    int count = Pa_GetDeviceCount(); 
     239    return count < 0 ? 0 : count; 
    239240} 
    240241 
     
    307308 
    308309    /* If still no device is found, enumerate all devices */ 
    309     count = Pa_GetDeviceCount(); 
     310    count = pjmedia_snd_get_dev_count(); 
    310311    for (i=0; i<count; ++i) { 
    311312        const PaDeviceInfo *paDevInfo; 
     
    363364 
    364365    /* If still no device is found, enumerate all devices */ 
    365     count = Pa_GetDeviceCount(); 
     366    count = pjmedia_snd_get_dev_count(); 
    366367    for (i=0; i<count; ++i) { 
    367368        const PaDeviceInfo *paDevInfo; 
     
    526527    stream->pool = pool; 
    527528    pj_strdup2_with_null(pool, &stream->name, paDevInfo->name); 
    528     stream->dir = stream->dir = PJMEDIA_DIR_PLAYBACK; 
     529    stream->dir = PJMEDIA_DIR_PLAYBACK; 
    529530    stream->play_id = index; 
    530531    stream->rec_id = -1; 
Note: See TracChangeset for help on using the changeset viewer.