Don't update to a single codec not in our offer

git-svn-id: http://yate.null.ro/svn/yate/trunk@1878 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2008-04-04 09:49:48 +00:00
parent 20b2efae8a
commit 69bec18f47
1 changed files with 9 additions and 4 deletions

View File

@ -958,10 +958,15 @@ bool NetMedia::update(const char* formats, int rport, int lport)
bool chg = false;
String tmp(formats);
if (m_formats != tmp) {
chg = true;
m_formats = tmp;
int q = m_formats.find(',');
m_format = m_formats.substr(0,q);
if ((tmp.find(',') < 0) && m_formats && m_formats.find(tmp) < 0)
Debug(&plugin,DebugInfo,"Not changing to '%s' from '%s' [%p]",
formats,m_formats.c_str(),this);
else {
chg = true;
m_formats = tmp;
int q = m_formats.find(',');
m_format = m_formats.substr(0,q);
}
}
if (rport >= 0) {
tmp = rport;