#include "linphonecore_utils.h"
+
static void play_finished(LsdPlayer *p){
const char *filename=(const char *)lsd_player_get_user_pointer (p);
ms_message("Playing of %s is finished.",filename);
if (!lsd_player_loop_enabled (p)){
- linphone_sound_daemon_release_player (lsd_player_get_daemon(p));
+ linphone_sound_daemon_release_player (lsd_player_get_daemon(p),p);
}
}
static void wait_a_bit(LinphoneCore *lc, int seconds){
- time_t orig=time(NULL);
- while(time(NULL)-orig<seconds){
+ time_t orig=ms_time(NULL);
+ while(ms_time(NULL)-orig<seconds){
/* we need to call iterate to receive notifications */
linphone_core_iterate(lc);
ms_usleep (50000);
linphone_core_enable_logs(stdout);
lc=linphone_core_new(&vtable,NULL,NULL,NULL);
- lsd=linphone_sound_daemon_new (NULL);
+ lsd=linphone_sound_daemon_new (NULL,44100,1);
linphone_core_use_sound_daemon(lc,lsd);
wait_a_bit(lc,10);
linphone_core_terminate_call(lc,NULL);
}
-
- linphone_core_destroy(lc);
+ linphone_core_use_sound_daemon(lc,NULL);
linphone_sound_daemon_destroy(lsd);
+ linphone_core_destroy(lc);
+
return 0;
}