Skip to content

Commit

Permalink
Merge pull request #20 from respoke/cleanup-opus-support
Browse files Browse the repository at this point in the history
Cleanup opus support
  • Loading branch information
chadxz committed Feb 5, 2016
2 parents 68e5634 + 6fdda42 commit a17a16d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions res/res_respoke/respoke_message_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,17 +680,17 @@ static struct ast_json *sdp_media_rtp_to_json(
int payload, struct ast_format *format)
{
const char *codec = ast_rtp_lookup_mime_subtype2(1, format, 0, 0);
struct ast_str *rate = ast_str_create(128);

ast_str_set(&rate, 128, "%i%s", ast_rtp_lookup_sample_rate2(1, format, -1), (strcmp(codec, "opus")) ? "" : "/2" );

return ast_json_pack(
"{s:i,s:s,s:s}",
struct ast_json *json = ast_json_pack(
"{s:i,s:s,s:i}",
"payload", payload,
"codec", codec,
"rate", ast_str_buffer(rate));
"rate", ast_rtp_lookup_sample_rate2(1, format, 0));

ast_free(rate);
if (json && !strcmp(codec, "opus")) {
integer_set(json, "encoding", 2);
}

return json;
}

static struct ast_json *sdp_media_fmtp_to_json(
Expand Down

0 comments on commit a17a16d

Please sign in to comment.