Changeset 949:28c34d323a39 in mediastreamer2


Ignore:
Timestamp:
Apr 27, 2010 5:55:21 PM (3 years ago)
Author:
Aymeric Moizard <jack@…>
Branch:
default
Message:

fix when card is removed after being detected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/winsndds.cpp

    r856 r949  
    13371337        ms_DirectSoundCaptureCreate( &d->in_guid, &d->lpDirectSoundCapture, NULL ); 
    13381338 
     1339        if (d->lpDirectSoundCapture==NULL) 
     1340                return; 
     1341 
    13391342        ZeroMemory(&captureDesc, sizeof(DSCBUFFERDESC)); 
    13401343        captureDesc.dwSize = sizeof(DSCBUFFERDESC); 
     
    13681371        WinSndDs *d=(WinSndDs*)f->data; 
    13691372 
    1370         ms_mutex_lock(&d->thread_lock); 
    1371         d->thread_running=FALSE; 
    1372         ms_cond_wait(&d->thread_cond,&d->thread_lock); 
    1373         ms_mutex_unlock(&d->thread_lock); 
    1374         ms_thread_join(d->thread,NULL); 
    1375  
    1376         ms_mutex_lock(&f->ticker->lock); 
    1377         ms_ticker_set_time_func(f->ticker,NULL,NULL); 
    1378         ms_mutex_unlock(&f->ticker->lock); 
     1373        if (d->thread_running==TRUE) 
     1374        { 
     1375                ms_mutex_lock(&d->thread_lock); 
     1376                d->thread_running=FALSE; 
     1377                ms_cond_wait(&d->thread_cond,&d->thread_lock); 
     1378                ms_mutex_unlock(&d->thread_lock); 
     1379                ms_thread_join(d->thread,NULL); 
     1380 
     1381                ms_mutex_lock(&f->ticker->lock); 
     1382                ms_ticker_set_time_func(f->ticker,NULL,NULL); 
     1383                ms_mutex_unlock(&f->ticker->lock); 
     1384        } 
    13791385 
    13801386        if( d->lpDirectSoundInputBuffer ) 
     
    15391545                ms_DirectSoundCreate( &d->out_guid, &d->lpDirectSound, NULL ); 
    15401546 
     1547                if (d->lpDirectSound==NULL) 
     1548                { 
     1549                        return ; 
     1550                } 
    15411551 
    15421552                hWnd = GetDesktopWindow(); 
Note: See TracChangeset for help on using the changeset viewer.