Browse code

core: include channels to SDP payload if channels == 2 - this is to make opus rtpmap standards compliant

Juha Heinanen authored on 12/12/2014 05:06:46
Showing 1 changed files
... ...
@@ -422,7 +422,8 @@ void AmPlugIn::getPayloads(vector<SdpPayload>& pl_vec) const
422 422
   for (std::map<int,int>::const_iterator it = payload_order.begin(); it != payload_order.end(); ++it) {
423 423
     std::map<int,amci_payload_t*>::const_iterator pl_it = payloads.find(it->second);
424 424
     if(pl_it != payloads.end()){
425
-      pl_vec.push_back(SdpPayload(pl_it->first, pl_it->second->name, pl_it->second->advertised_sample_rate, 0));
425
+      // if channels==2 use that value; otherwise don't add channels param
426
+      pl_vec.push_back(SdpPayload(pl_it->first, pl_it->second->name, pl_it->second->advertised_sample_rate, pl_it->second->channels==2?2:0));
426 427
     } else {
427 428
       ERROR("Payload %d (from the payload_order map) was not found in payloads map!\n", it->second);
428 429
     }