Changeset 1422


Ignore:
Timestamp:
Aug 22, 2007 12:34:48 PM (17 years ago)
Author:
bennylp
Message:

Fixed bug in dsound.c: handled case when lpGUID is NULL (common for primary devices). Thanks Yejun Yang

File:
1 edited

Legend:

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

    r1421 r1422  
    5252{ 
    5353    pjmedia_snd_dev_info    info; 
     54    LPGUID                  lpGuid; 
    5455    GUID                    guid; 
    5556}; 
     
    159160     * Create DirectSound device. 
    160161     */ 
    161     hr = DirectSoundCreate(&dev_info[dev_id].guid, &ds_strm->ds.play.lpDs,  
     162    hr = DirectSoundCreate(dev_info[dev_id].lpGuid, &ds_strm->ds.play.lpDs,  
    162163                           NULL); 
    163164    if (FAILED(hr)) 
     
    278279     * Creating recorder device. 
    279280     */ 
    280     hr = DirectSoundCaptureCreate(&dev_info[dev_id].guid,  
     281    hr = DirectSoundCaptureCreate(dev_info[dev_id].lpGuid,  
    281282                                  &ds_strm->ds.capture.lpDs, NULL); 
    282283    if (FAILED(hr)) 
     
    602603     */ 
    603604    for (index=0; index<dev_count; ++index) { 
    604         if (pj_memcmp(&dev_info[index].guid, lpGuid, sizeof(GUID))==0) 
     605        if ((dev_info[index].lpGuid==NULL && lpGuid==NULL) || 
     606            pj_memcmp(&dev_info[index].guid, lpGuid, sizeof(GUID))==0) 
     607        { 
    605608            break; 
     609        } 
    606610    } 
    607611 
     
    617621    strncpy(dev_info[index].info.name, lpcstrDescription, max); 
    618622    dev_info[index].info.name[max-1] = '\0'; 
    619     pj_memcpy(&dev_info[index].guid, lpGuid, sizeof(GUID)); 
     623    if (lpGuid == NULL) { 
     624        dev_info[index].lpGuid = NULL; 
     625    } else { 
     626        pj_memcpy(&dev_info[index].guid, lpGuid, sizeof(GUID)); 
     627        dev_info[index].lpGuid = &dev_info[index].guid; 
     628    } 
    620629    dev_info[index].info.default_samples_per_sec = 44100; 
    621630     
Note: See TracChangeset for help on using the changeset viewer.