prefer-codecs.js
function convertToCodecDefinition(r, line) {
    if (!line || line[0] !== 'a') return r;

    var result = reRtpMap.exec(line[1]);
    if (!result) return r;

    // Build the codec definition
    var codec = result[2];
    var typeNum = result[1];
    r[codec.toUpperCase()] = {
      num: typeNum,
      codec: codec
    }
    return r;
  }
function convertToCodecDefinition(r, line) {
    if (!line || line[0] !== 'a') return r;

    var result = reRtpMap.exec(line[1]);
    if (!result) return r;

    // Build the codec definition
    var codec = result[2];
    var typeNum = result[1];
    r[codec.toUpperCase()] = {
      num: typeNum,
      codec: codec
    }
    return r;
  }
function convertToCodecDefinition ( r , line ) { if ( ! line || line [ 0 ] !== 'a' ) return r ; var result = reRtpMap . exec ( line [ 1 ] ) ; if ( ! result ) return r ; // Build the codec definition var codec = result [ 2 ] ; var typeNum = result [ 1 ] ; r [ codec . toUpperCase ( ) ] = { num : typeNum , codec : codec } return r ; }
Converts rtpmap definitions to a codec lookup object
Converts rtpmap definitions to a codec lookup object