diff options
author | Richard Mudgett <rmudgett@digium.com> | 2014-08-20 22:52:44 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2014-08-20 22:52:44 +0000 |
commit | b7f98c3da45411c7394ebf5ebef2f800fb11e3d1 (patch) | |
tree | 27dc9b09faf866e8c6305351995a72af30e9fc65 /main/file.c | |
parent | 4672c139ddcaa7bae6600ed2ec330192a87f2883 (diff) |
chan_pjsip: Update media translation paths when new SDP negotiated.
On a SIP reinvite that changes media strams, the PJSIP channel driver was
flooding the log with "Asked to transmit frame type %s, while native
formats is %s" warnings.
* Fixes PJSIP not setting up translation paths when the formats change on
a reinvite. AFS-63 was effectively reintroduced because of the media
formats work. res_pjsip_sdp_rtp.c:set_caps()
* Improved the unexpected frame format WARNING message to include more
information.
* Added protective locking while altering formats on a channel. Reworked
set_format() to simplify and protect the formats under manipulation.
* Restored some code that got lost in the media_formats work.
(channel.c:set_format() and res_pjsip_sdp_rtp.c:set_caps())
AFS-137 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/3906/
........
Merged revisions 421645 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/file.c')
-rw-r--r-- | main/file.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/main/file.c b/main/file.c index b12883d49..393832cdd 100644 --- a/main/file.c +++ b/main/file.c @@ -777,9 +777,11 @@ struct ast_filestream *ast_openstream_full(struct ast_channel *chan, const char } /* Set the channel to a format we can work with and save off the previous format. */ + ast_channel_lock(chan); ast_channel_set_oldwriteformat(chan, ast_channel_writeformat(chan)); /* Set the channel to the best format that exists for the file. */ res = ast_set_write_format_from_cap(chan, file_fmt_cap); + ast_channel_unlock(chan); /* don't need this anymore now that the channel's write format is set. */ ao2_ref(file_fmt_cap, -1); |