Commit 9b7dd73b authored by Mickaël Turnel's avatar Mickaël Turnel

Fix local player not getting the core properly

(cherry picked from commit ee5d1bbb)
parent 67af6475
......@@ -33,7 +33,7 @@ static void _local_player_destroy(LinphonePlayer *obj);
static void _local_player_eof_callback(void *user_data);
LinphonePlayer *linphone_core_create_local_player(LinphoneCore *lc, const char *sound_card_name, const char *video_display_name, void *window_id) {
LinphonePlayer *obj = linphone_player_new();
LinphonePlayer *obj = linphone_player_new(lc);
MSSndCard *snd_card;
MSSndCardManager *snd_card_manager = ms_factory_get_snd_card_manager(lc->factory);
if (sound_card_name == NULL) sound_card_name = linphone_core_get_ringer_device(lc);
......
......@@ -32,9 +32,10 @@ BELLE_SIP_INSTANCIATE_VPTR(LinphonePlayer, belle_sip_object_t,
FALSE
);
LinphonePlayer * linphone_player_new(void) {
LinphonePlayer * linphone_player_new(LinphoneCore *core) {
LinphonePlayer *player = belle_sip_object_new(LinphonePlayer);
player->callbacks = linphone_player_cbs_new();
player->core = core;
return player;
}
......@@ -59,6 +60,10 @@ LinphonePlayerCbs * linphone_player_get_callbacks(const LinphonePlayer *player)
return player->callbacks;
}
LinphoneCore *linphone_player_get_core(const LinphonePlayer *player){
return player->core;
}
LinphoneStatus linphone_player_open(LinphonePlayer *obj, const char *filename){
return obj->open(obj,filename);
}
......@@ -197,7 +202,7 @@ static void on_call_destroy(void *obj, belle_sip_object_t *call_being_destroyed)
}
LinphonePlayer *linphone_call_build_player(LinphoneCall *call){
LinphonePlayer *obj = linphone_player_new();
LinphonePlayer *obj = linphone_player_new(linphone_call_get_core(call));
obj->open=call_player_open;
obj->close=call_player_close;
obj->start=call_player_start;
......@@ -209,10 +214,6 @@ LinphonePlayer *linphone_call_build_player(LinphoneCall *call){
return obj;
}
LinphoneCore *linphone_player_get_core(const LinphonePlayer *player){
return linphone_call_get_core((LinphoneCall *)player->impl);
}
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphonePlayerCbs);
BELLE_SIP_INSTANCIATE_VPTR(LinphonePlayerCbs, belle_sip_object_t,
......
......@@ -450,7 +450,7 @@ LINPHONE_PUBLIC int linphone_remote_provisioning_load_file( LinphoneCore* lc, co
****************************************************************************/
LinphonePlayerCbs *linphone_player_cbs_new(void);
LinphonePlayer * linphone_player_new(void);
LinphonePlayer * linphone_player_new(LinphoneCore *core);
void _linphone_player_destroy(LinphonePlayer *player);
......
......@@ -604,6 +604,7 @@ struct _LinphonePlayer{
void (*destroy)(LinphonePlayer *player);
void *impl;
LinphonePlayerCbs *callbacks;
LinphoneCore *core;
};
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphonePlayer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment