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:
Benny Prijono 2007-02-17 19:34:46 +00:00
parent 9fe1ad2dec
commit 4abeb9be2e
2 changed files with 18 additions and 0 deletions

View File

@ -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);

View File

@ -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);