Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
d3f921ed
Commit
d3f921ed
authored
8 years ago
by
George Joseph
Committed by
Gerrit Code Review
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge "res_format_attr_opus: Fix fmtp generation." into 13
parents
c877801e
2c031b67
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
res/res_format_attr_opus.c
+6
-4
6 additions, 4 deletions
res/res_format_attr_opus.c
with
6 additions
and
4 deletions
res/res_format_attr_opus.c
+
6
−
4
View file @
d3f921ed
...
@@ -158,7 +158,8 @@ static struct ast_format *opus_parse_sdp_fmtp(const struct ast_format *format, c
...
@@ -158,7 +158,8 @@ static struct ast_format *opus_parse_sdp_fmtp(const struct ast_format *format, c
static
void
opus_generate_sdp_fmtp
(
const
struct
ast_format
*
format
,
unsigned
int
payload
,
struct
ast_str
**
str
)
static
void
opus_generate_sdp_fmtp
(
const
struct
ast_format
*
format
,
unsigned
int
payload
,
struct
ast_str
**
str
)
{
{
struct
opus_attr
*
attr
=
ast_format_get_attribute_data
(
format
);
struct
opus_attr
*
attr
=
ast_format_get_attribute_data
(
format
);
int
size
;
int
base_fmtp_size
;
int
original_size
;
if
(
!
attr
)
{
if
(
!
attr
)
{
/*
/*
...
@@ -169,7 +170,8 @@ static void opus_generate_sdp_fmtp(const struct ast_format *format, unsigned int
...
@@ -169,7 +170,8 @@ static void opus_generate_sdp_fmtp(const struct ast_format *format, unsigned int
attr
=
&
default_opus_attr
;
attr
=
&
default_opus_attr
;
}
}
size
=
ast_str_append
(
str
,
0
,
"a=fmtp:%u "
,
payload
);
original_size
=
ast_str_strlen
(
*
str
);
base_fmtp_size
=
ast_str_append
(
str
,
0
,
"a=fmtp:%u "
,
payload
);
if
(
CODEC_OPUS_DEFAULT_SAMPLE_RATE
!=
attr
->
maxplayrate
)
{
if
(
CODEC_OPUS_DEFAULT_SAMPLE_RATE
!=
attr
->
maxplayrate
)
{
ast_str_append
(
str
,
0
,
"%s=%d;"
,
ast_str_append
(
str
,
0
,
"%s=%d;"
,
...
@@ -211,8 +213,8 @@ static void opus_generate_sdp_fmtp(const struct ast_format *format, unsigned int
...
@@ -211,8 +213,8 @@ static void opus_generate_sdp_fmtp(const struct ast_format *format, unsigned int
CODEC_OPUS_ATTR_DTX
,
attr
->
dtx
);
CODEC_OPUS_ATTR_DTX
,
attr
->
dtx
);
}
}
if
(
size
==
ast_str_strlen
(
*
str
))
{
if
(
base_fmtp_
size
==
ast_str_strlen
(
*
str
)
-
original_size
)
{
ast_str_
reset
(
*
str
);
ast_str_
truncate
(
*
str
,
original_size
);
}
else
{
}
else
{
ast_str_truncate
(
*
str
,
-
1
);
ast_str_truncate
(
*
str
,
-
1
);
ast_str_append
(
str
,
0
,
"
\r\n
"
);
ast_str_append
(
str
,
0
,
"
\r\n
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment