I think this the following loop in SDPMedia::update that needs change
else if (m_formats && !force) {
// from received list keep only already offered formats
ObjList* l1 = tmp.split(',',false);
ObjList* l2 = m_formats.split(',',false);
for (ObjList* fmt = l1->skipNull(); fmt; ) {
if (l2->find(fmt->get()->toString()))
fmt = fmt->skipNext();
else {
fmt->remove();
fmt = fmt->skipNull();
}
}
ilbc20 should not be removed when there is ilbc30 in ObjList l2 and ilbc30 should not be removed when there is ilbc20 in ObjList l2.
For that the else part must be extended to something like:
if ( the format is ilbc20 and there is ilbc30 in ObjList l2) {
put ilbc30 in fmt instead of ilbc20;
}elseif ( the format is ilbc30 and there is ilbc20 in ObjList l2) {
fmt = fmt->skipNext();
}else {
fmt->remove();
fmt = fmt->skipNull();
}
I don't know yet which opportunities the Object list class and the string class give me. I am no real programmer and I will nedd some time to fully unterstand the code. and i don't even really know if this is the right approach
also something similar have to be done if only a single format is received.(few line above that code)
comments on this are appreciated