From f09e3cd1360b23dc8c9483e4ffd228e55700d126 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 20 Dec 2017 17:34:11 +0100 Subject: [PATCH] fix double callback notification of EOP on LinphonePlayer --- coreapi/player.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/coreapi/player.c b/coreapi/player.c index fcfee87f3..ac9e3f5ab 100644 --- a/coreapi/player.c +++ b/coreapi/player.c @@ -134,9 +134,13 @@ static bool_t call_player_check_state(LinphonePlayer *player, bool_t check_playe static void on_eof(void *user_data, MSFilter *f, unsigned int event_id, void *arg){ LinphonePlayer *player=(LinphonePlayer *)user_data; - LinphonePlayerCbs *cbs = linphone_player_get_callbacks(player); - LinphonePlayerCbsEofReachedCb cb = linphone_player_cbs_get_eof_reached(cbs); - if (cb) cb(player); + switch (event_id){ + case MS_PLAYER_EOF: + LinphonePlayerCbs *cbs = linphone_player_get_callbacks(player); + LinphonePlayerCbsEofReachedCb cb = linphone_player_cbs_get_eof_reached(cbs); + if (cb) cb(player); + break; + } } static int call_player_open(LinphonePlayer* player, const char *filename){