Added sleep() before destroying sound device in playfile and playsine to prevent audio stutters
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@959 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
9fe1ad2dec
commit
4abeb9be2e
|
@ -176,6 +176,15 @@ int main(int argc, char *argv[])
|
|||
|
||||
/* Start deinitialization: */
|
||||
|
||||
/* Disconnect sound port from file port */
|
||||
status = pjmedia_snd_port_disconnect(snd_port);
|
||||
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
|
||||
|
||||
/* Without this sleep, Windows/DirectSound will repeteadly
|
||||
* play the last frame during destroy.
|
||||
*/
|
||||
pj_thread_sleep(100);
|
||||
|
||||
/* Destroy sound device */
|
||||
status = pjmedia_snd_port_destroy( snd_port );
|
||||
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
|
||||
|
|
|
@ -281,6 +281,15 @@ int main(int argc, char *argv[])
|
|||
|
||||
/* Start deinitialization: */
|
||||
|
||||
/* Disconnect sound port from file port */
|
||||
status = pjmedia_snd_port_disconnect(snd_port);
|
||||
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
|
||||
|
||||
/* Without this sleep, Windows/DirectSound will repeteadly
|
||||
* play the last frame during destroy.
|
||||
*/
|
||||
pj_thread_sleep(100);
|
||||
|
||||
/* Destroy sound device */
|
||||
status = pjmedia_snd_port_destroy( snd_port );
|
||||
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
|
||||
|
|
Loading…
Reference in New Issue