Changeset 2366 for pjproject/trunk


Ignore:
Timestamp:
Nov 12, 2008 10:48:05 AM (16 years ago)
Author:
nanang
Message:

Fixed bug of unresetted static var dev_info that caused device name gets repeated on second call or soon of snd_init() (thanks Steven Back for the report).

File:
1 edited

Legend:

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

    r2290 r2366  
    4141static unsigned dev_count; 
    4242static struct wmme_dev_info dev_info[MAX_HARDWARE]; 
    43 static int snd_init_count; 
     43static pj_bool_t snd_initialized = PJ_FALSE; 
    4444 
    4545/* Latency settings */ 
     
    484484    int inputDeviceCount, outputDeviceCount, maximumPossibleDeviceCount; 
    485485 
    486     if (++snd_init_count != 1) 
     486    if (snd_initialized) 
    487487        return PJ_SUCCESS; 
     488 
     489    pj_bzero(&dev_info, sizeof(dev_info)); 
    488490 
    489491    dev_count = 0; 
     
    618620PJ_DEF(pj_status_t) pjmedia_snd_deinit(void) 
    619621{ 
    620     --snd_init_count; 
     622    snd_initialized = PJ_FALSE; 
    621623    return PJ_SUCCESS; 
    622624} 
Note: See TracChangeset for help on using the changeset viewer.