Changeset 959 for pjproject


Ignore:
Timestamp:
Feb 17, 2007 7:34:46 PM (18 years ago)
Author:
bennylp
Message:

Added sleep() before destroying sound device in playfile and playsine to prevent audio stutters

Location:
pjproject/trunk/pjsip-apps/src/samples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/samples/playfile.c

    r815 r959  
    177177    /* Start deinitialization: */ 
    178178 
     179    /* Disconnect sound port from file port */ 
     180    status = pjmedia_snd_port_disconnect(snd_port); 
     181    PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); 
     182 
     183    /* Without this sleep, Windows/DirectSound will repeteadly 
     184     * play the last frame during destroy. 
     185     */ 
     186    pj_thread_sleep(100); 
     187 
    179188    /* Destroy sound device */ 
    180189    status = pjmedia_snd_port_destroy( snd_port ); 
  • pjproject/trunk/pjsip-apps/src/samples/playsine.c

    r815 r959  
    282282    /* Start deinitialization: */ 
    283283 
     284    /* Disconnect sound port from file port */ 
     285    status = pjmedia_snd_port_disconnect(snd_port); 
     286    PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); 
     287 
     288    /* Without this sleep, Windows/DirectSound will repeteadly 
     289     * play the last frame during destroy. 
     290     */ 
     291    pj_thread_sleep(100); 
     292 
    284293    /* Destroy sound device */ 
    285294    status = pjmedia_snd_port_destroy( snd_port ); 
Note: See TracChangeset for help on using the changeset viewer.