Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
617fcd2c
Commit
617fcd2c
authored
Mar 16, 2011
by
Jean-Marc Valin
Browse files
Fixes a few PLC/DTX bugs due to the recent decode API change
parent
d4341929
Changes
4
Hide whitespace changes
Inline
Side-by-side
celt
@
1a8bf37d
Subproject commit
6f6e8b39842a7d175e89f47e4d37ad5de8143ad2
Subproject commit
1a8bf37dbaa461d410c101d1be302a67b4927035
src/opus_decoder.c
View file @
617fcd2c
...
...
@@ -216,8 +216,9 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
/* Shrink decoder because of raw bits */
dec
.
storage
-=
redundancy_bytes
;
}
start_band
=
17
;
}
if
(
mode
!=
MODE_CELT_ONLY
)
start_band
=
17
;
if
(
mode
!=
MODE_SILK_ONLY
)
{
...
...
@@ -343,7 +344,9 @@ int opus_decode(OpusDecoder *st, const unsigned char *data,
unsigned
char
ch
,
toc
;
/* 48 x 2.5 ms = 120 ms */
short
size
[
48
];
if
(
len
<
1
)
if
(
len
==
0
||
data
==
NULL
)
return
opus_decode_frame
(
st
,
NULL
,
0
,
pcm
,
frame_size
,
0
);
else
if
(
len
<
0
)
return
CELT_BAD_ARG
;
st
->
mode
=
opus_packet_get_mode
(
data
);
st
->
bandwidth
=
opus_packet_get_bandwidth
(
data
);
...
...
src/opus_encoder.c
View file @
617fcd2c
...
...
@@ -293,6 +293,9 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
fprintf
(
stderr
,
"SILK encode error: %d
\n
"
,
ret
);
/* Handle error */
}
if
(
nBytes
==
0
)
return
0
;
/* Extract SILK internal bandwidth for signaling in first byte */
if
(
st
->
mode
==
MODE_SILK_ONLY
)
{
if
(
st
->
silk_mode
.
internalSampleRate
==
8000
)
{
...
...
src/test_opus.c
View file @
617fcd2c
...
...
@@ -285,13 +285,13 @@ int main(int argc, char *argv[])
#if OPUS_TEST_RANGE_CODER_STATE
enc_final_range
[
toggle
]
=
opus_encoder_get_final_range
(
enc
);
#endif
if
(
len
[
toggle
]
<
=
0
)
if
(
len
[
toggle
]
<
0
)
{
fprintf
(
stderr
,
"opus_encode() returned %d
\n
"
,
len
[
toggle
]);
return
1
;
}
lost
=
rand
()
%
100
<
packet_loss_perc
;
lost
=
rand
()
%
100
<
packet_loss_perc
||
len
[
toggle
]
==
0
;
if
(
count
>=
use_inbandfec
)
{
/* delay by one packet when using in-band FEC */
if
(
use_inbandfec
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment