Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
f168d735
Commit
f168d735
authored
Jan 8, 2014
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #38241: opus: add return code checking
parent
f6e23e2d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
daemon/src/audio/codecs/opus.cpp
+17
-5
17 additions, 5 deletions
daemon/src/audio/codecs/opus.cpp
with
17 additions
and
5 deletions
daemon/src/audio/codecs/opus.cpp
+
17
−
5
View file @
f168d735
...
@@ -83,28 +83,40 @@ Opus::getSDPChannels() const
...
@@ -83,28 +83,40 @@ Opus::getSDPChannels() const
int
Opus
::
decode
(
SFLAudioSample
*
dst
,
unsigned
char
*
buf
,
size_t
buffer_size
)
int
Opus
::
decode
(
SFLAudioSample
*
dst
,
unsigned
char
*
buf
,
size_t
buffer_size
)
{
{
return
opus_decode
(
decoder_
,
buf
,
buffer_size
,
dst
,
FRAME_SIZE
,
0
);
const
int
ret
=
opus_decode
(
decoder_
,
buf
,
buffer_size
,
dst
,
FRAME_SIZE
,
0
);
if
(
ret
<
0
)
std
::
cerr
<<
opus_strerror
(
ret
)
<<
std
::
endl
;
return
ret
;
}
}
int
Opus
::
encode
(
unsigned
char
*
dst
,
SFLAudioSample
*
src
,
size_t
buffer_size
)
int
Opus
::
encode
(
unsigned
char
*
dst
,
SFLAudioSample
*
src
,
size_t
buffer_size
)
{
{
return
opus_encode
(
encoder_
,
src
,
FRAME_SIZE
,
dst
,
buffer_size
*
2
);
const
int
ret
=
opus_encode
(
encoder_
,
src
,
FRAME_SIZE
,
dst
,
buffer_size
*
2
);
if
(
ret
<
0
)
std
::
cerr
<<
opus_strerror
(
ret
)
<<
std
::
endl
;
return
ret
;
}
}
int
Opus
::
decode
(
std
::
vector
<
std
::
vector
<
SFLAudioSample
>
>
&
dst
,
unsigned
char
*
buf
,
size_t
buffer_size
)
int
Opus
::
decode
(
std
::
vector
<
std
::
vector
<
SFLAudioSample
>
>
&
dst
,
unsigned
char
*
buf
,
size_t
buffer_size
)
{
{
if
(
buf
==
NULL
)
return
0
;
if
(
buf
==
NULL
)
return
0
;
unsigned
samples
=
opus_decode
(
decoder_
,
buf
,
buffer_size
,
dst
[
0
].
data
(),
sizeof
(
SFLAudioSample
)
*
FRAME_SIZE
,
0
);
const
int
ret
=
opus_decode
(
decoder_
,
buf
,
buffer_size
,
dst
[
0
].
data
(),
sizeof
(
SFLAudioSample
)
*
FRAME_SIZE
,
0
);
if
(
ret
<
0
)
std
::
cerr
<<
opus_strerror
(
ret
)
<<
std
::
endl
;
return
samples
;
return
ret
;
}
}
int
Opus
::
encode
(
unsigned
char
*
dst
,
std
::
vector
<
std
::
vector
<
SFLAudioSample
>
>
&
src
,
size_t
buffer_size
)
int
Opus
::
encode
(
unsigned
char
*
dst
,
std
::
vector
<
std
::
vector
<
SFLAudioSample
>
>
&
src
,
size_t
buffer_size
)
{
{
if
(
dst
==
NULL
)
return
0
;
if
(
dst
==
NULL
)
return
0
;
return
opus_encode
(
encoder_
,
src
[
0
].
data
(),
FRAME_SIZE
,
dst
,
buffer_size
*
sizeof
(
SFLAudioSample
));
const
int
ret
=
opus_encode
(
encoder_
,
src
[
0
].
data
(),
FRAME_SIZE
,
dst
,
buffer_size
*
sizeof
(
SFLAudioSample
));
if
(
ret
<
0
)
std
::
cerr
<<
opus_strerror
(
ret
)
<<
std
::
endl
;
return
ret
;
}
}
...
...
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
sign in
to comment