mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-24 14:48:07 +00:00
Fix change of payload type number.
When changing the payload type number, the rtp profile needs to be changed also.
This commit is contained in:
parent
665fd8693b
commit
fe5579abb3
1 changed files with 6 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "audio-codec-set.h"
|
||||
|
||||
/*hack, until this function comes to linphonecore*/
|
||||
#define _payload_type_get_number(pt) ((long)(pt)->user_data)
|
||||
#define _payload_type_set_number(pt,n) (pt)->user_data=(void*)(long)(n)
|
||||
|
||||
using namespace std;
|
||||
|
|
@ -71,7 +72,11 @@ void AudioCodecSetCommand::exec(Daemon *app, const char *args) {
|
|||
if (conflict) {
|
||||
app->sendResponse(Response("New payload type number is already used.", Response::Error));
|
||||
} else {
|
||||
_payload_type_set_number(payload, atoi(value.c_str()));
|
||||
int idx = atoi(value.c_str());
|
||||
long old_idx = _payload_type_get_number(payload);
|
||||
_payload_type_set_number(payload, idx);
|
||||
rtp_profile_set_payload(&av_profile, idx, payload);
|
||||
rtp_profile_clear_payload(&av_profile, old_idx);
|
||||
app->sendResponse(PayloadTypeResponse(app->getCore(), payload, index));
|
||||
}
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue