Skip to content

Commit

Permalink
fix(opus) opus_decode_float signature
Browse files Browse the repository at this point in the history
Close #785
  • Loading branch information
Spasi committed Jul 28, 2022
1 parent 6e813a0 commit 28cccba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/notes/3.3.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ This build includes the following changes:
- Core: Fixed Java/native library incompatibility detection. (#737)
- Core: Fixed `dlerror` decoding to use UTF-8. (#738)
- Build: Fixed offline mode with multiple local architectures. (#740)
- Opus: Fixed `pcm` parameter type of `opus_decode_float` function. (#785)
- Vulkan: Fixed definition of the `VK_API_VERSION_PATCH` macro. (#743)
- Vulkan: Fixed `EXT_debug_utils` function dispatch. (#755)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ public static int nopus_decode_float(long st, long data, int len, long pcm, int
*
* @param st decoder state
* @param data input payload (Use a {@code NULL} pointer to indicate packet loss)
* @param pcm output signal (interleaved if 2 channels) (length is {@code frame_size*channels*sizeof(opus_int16)}
* @param pcm output signal (interleaved if 2 channels) (length is {@code frame_size*channels*sizeof(float)}
* @param frame_size number of samples per channel of available space in pcm.
*
* <p>If this is less than the maximum packet duration (120ms; 5760 for 48kHz), this function will not be capable of decoding some packets. In the case
Expand All @@ -888,7 +888,7 @@ public static int nopus_decode_float(long st, long data, int len, long pcm, int
*
* @return number of decoded samples or a negative error code
*/
public static int opus_decode_float(@NativeType("OpusDecoder *") long st, @Nullable @NativeType("unsigned char const *") ByteBuffer data, @NativeType("opus_int16 *") ShortBuffer pcm, int frame_size, int decode_fec) {
public static int opus_decode_float(@NativeType("OpusDecoder *") long st, @Nullable @NativeType("unsigned char const *") ByteBuffer data, @NativeType("float *") FloatBuffer pcm, int frame_size, int decode_fec) {
if (CHECKS) {
check(pcm, frame_size * memGetInt(st + 8));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ if (nb_packets > 0)
Check(
// Reading OpusDecoder internal state here
"frame_size * memGetInt(st + 8)"
)..opus_int16.p("pcm", "output signal (interleaved if 2 channels) (length is {@code frame_size*channels*sizeof(opus_int16)}"),
)..float.p("pcm", "output signal (interleaved if 2 channels) (length is {@code frame_size*channels*sizeof(float)}"),
int(
"frame_size",
"""
Expand Down

0 comments on commit 28cccba

Please sign in to comment.