diff options
author | Liong Sauw Ming <ming@teluu.com> | 2015-08-27 02:23:55 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2015-08-27 02:23:55 +0000 |
commit | 94e929da42f81d9427d610d3e5b0032fa37e8971 (patch) | |
tree | 0b5838a39d9a59ae67adde750318726d8aef8d7e /pjmedia | |
parent | 7ffa781dc39a7274692d8db11043b3a9e92e36ce (diff) |
Re #1882 (misc): In iOS, set the option to notify other apps upon audio session deactivation. This will be useful so other apps can return to active state and resume its audio.
Thanks to Johan Lantz for the patch.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5171 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r-- | pjmedia/src/pjmedia-audiodev/coreaudio_dev.m | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m b/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m index c5c9e947..b3a4a787 100644 --- a/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m +++ b/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m @@ -2082,8 +2082,17 @@ static pj_status_t ca_stream_stop(pjmedia_aud_stream *strm) #if !COREAUDIO_MAC if (should_deactivate) { - if ([stream->sess setActive:false error:nil] != YES) { - PJ_LOG(4, (THIS_FILE, "Warning: cannot deactivate audio session")); + if ([stream->sess + respondsToSelector:@selector(setActive:withOptions:error:)]) + { + [stream->sess setActive:NO + withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation + error:nil]; + } else { + if ([stream->sess setActive:NO error:nil] != YES) { + PJ_LOG(4, (THIS_FILE, "Warning: cannot deactivate " + "audio session")); + } } } #endif |