diff --git a/daemon/codec.c b/daemon/codec.c index b6634557f..09d1d4bb4 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -1501,8 +1501,10 @@ void __codec_handlers_update(struct call_media *source, struct call_media *sink, // default choice of audio player usage is based on whether it was in use previously, // overridden by signalling flags, overridden by global option - bool use_audio_player = !!MEDIA_ISSET(sink, AUDIO_PLAYER); + bool use_audio_player = !!MEDIA_ISSET(sink, AUDIO_PLAYER) && !MEDIA_ISSET(sink, AUDIO_PLAYER_IMPLICIT); + bool implicit_audio_player = false; + MEDIA_CLEAR(sink, AUDIO_PLAYER_IMPLICIT); if (rtpe_config.use_audio_player == UAP_PLAY_MEDIA) { // check for implicitly enabled player @@ -1799,10 +1801,13 @@ sink_pt_fixed:; transcode: // enable audio player if not explicitly disabled - if (rtpe_config.use_audio_player == UAP_TRANSCODING && (!a.flags || a.flags->audio_player != AP_OFF)) - use_audio_player = true; - else if (a.flags && a.flags->audio_player == AP_TRANSCODING) + if ((rtpe_config.use_audio_player == UAP_TRANSCODING + && (!a.flags || a.flags->audio_player != AP_OFF)) + || (a.flags && a.flags->audio_player == AP_TRANSCODING)) + { use_audio_player = true; + implicit_audio_player = true; + } if (use_audio_player) { // when using the audio player, everything must decode to the same @@ -1853,8 +1858,8 @@ next: MEDIA_CLEAR(sink, AUDIO_PLAYER); audio_player_stop(sink); } - else if (!implicit_audio_player) - MEDIA_SET(sink, AUDIO_PLAYER); + else if (implicit_audio_player) + MEDIA_SET(sink, AUDIO_PLAYER_IMPLICIT); if (is_transcoding) { if (a.reset_transcoding && ms) diff --git a/include/call.h b/include/call.h index 46a08ea6f..6e3771508 100644 --- a/include/call.h +++ b/include/call.h @@ -221,6 +221,7 @@ enum { #define MEDIA_FLAG_PUBLIC (1LL << 38) #define MEDIA_FLAG_EXTMAP_SHORT SHARED_FLAG_EXTMAP_SHORT #define MEDIA_FLAG_BUNDLE_ONLY (1LL << 40) +#define MEDIA_FLAG_AUDIO_PLAYER_IMPLICIT (1LL << 41) /* struct call_monologue */ #define ML_FLAG_REC_FORWARDING (1LL << 16)