MT#62272 media player: move moh bool to opts

Instead of keeping it in the player itself
use opts for that.

Change-Id: Ib606c3794f9ed3266a18228be73d5eddda904324
coverity_scan
Donat Zenichev 11 months ago
parent caeeb26f16
commit edf1f9bd2d

@ -1497,7 +1497,7 @@ bool call_ml_stops_moh(struct call_monologue *from_ml, struct call_monologue *to
enum ng_opmode opmode)
{
#ifdef WITH_TRANSCODING
if (opmode == OP_OFFER && !call_ml_sendonly_inactive(from_ml) && (to_ml->player && to_ml->player->moh))
if (opmode == OP_OFFER && !call_ml_sendonly_inactive(from_ml) && (to_ml->player && to_ml->player->opts.moh))
{
return true;
}
@ -1577,7 +1577,7 @@ const char * call_check_moh(struct call_monologue *from_ml, struct call_monologu
if (errstr)
return errstr;
/* mark player as used for MoH */
to_ml->player->moh = true;
to_ml->player->opts.moh = true;
/* handle MoH related flags */
call_ml_moh_handle_flags(from_ml, to_ml);
@ -1588,7 +1588,7 @@ const char * call_check_moh(struct call_monologue *from_ml, struct call_monologu
/* whom to stop the moh audio */
call_stop_media_for_ml(to_ml);
/* mark MoH as already not used (it can be unset now) */
to_ml->player->moh = false;
to_ml->player->opts.moh = false;
ilog(LOG_DEBUG, "Music on hold stopped with coming SDP offer.");
}

@ -2837,7 +2837,7 @@ static void sdp_out_add_other(GString *out, struct call_monologue *monologue,
if (flags->loop_protect)
append_attr_to_gstring(out, "rtpengine", &rtpe_instance_id, flags, media->type_id);
#ifdef WITH_TRANSCODING
if (monologue->player && monologue->player->moh && rtpe_config.moh_attr_name) {
if (monologue->player && monologue->player->opts.moh && rtpe_config.moh_attr_name) {
append_attr_to_gstring(out, rtpe_config.moh_attr_name, NULL, flags, media->type_id);
}
#endif

@ -26,6 +26,7 @@ typedef struct {
unsigned int block_egress:1;
str file, blob;
long long db_id;
bool moh;
} media_player_opts_t;
@ -86,7 +87,6 @@ struct media_player {
unsigned long sync_ts;
struct timeval sync_ts_tv;
long long last_frame_ts;
bool moh;
};
INLINE void media_player_put(struct media_player **mp) {

Loading…
Cancel
Save