Skip to content

Commit

Permalink
fdk-aac fix from walkyst
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed May 24, 2023
1 parent a4b5384 commit 38d16be
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions natives/connector/fdk-aac.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ CONNECTOR_EXPORT void JNICALL Java_com_sedmelluq_discord_lavaplayer_natives_aac_
aacDecoder_Close((HANDLE_AACDECODER) instance);
}

CONNECTOR_EXPORT jint JNICALL Java_com_sedmelluq_discord_lavaplayer_natives_aac_AacDecoderLibrary_configure(JNIEnv *jni, jobject me, jlong instance, jlong buffer_data) {
UCHAR* buffer = (UCHAR*)&buffer_data;
UINT length = sizeof(jlong);

return aacDecoder_ConfigRaw((HANDLE_AACDECODER) instance, &buffer, &length);
CONNECTOR_EXPORT jint JNICALL Java_com_sedmelluq_discord_lavaplayer_natives_aac_AacDecoderLibrary_configure(JNIEnv *jni, jobject me, jlong instance, jbyteArray config) {
jbyte* config_bytes = (*jni)->GetByteArrayElements(jni, config, NULL);
jsize config_length = (*jni)->GetArrayLength(jni, config);
UCHAR* config_buffer = (UCHAR*)config_bytes;
int result = aacDecoder_ConfigRaw((HANDLE_AACDECODER) instance, &config_buffer, &config_length);
(*jni)->ReleaseByteArrayElements(jni, config, config_bytes, JNI_ABORT);
return result;
}

CONNECTOR_EXPORT jint JNICALL Java_com_sedmelluq_discord_lavaplayer_natives_aac_AacDecoderLibrary_fill(JNIEnv *jni, jobject me, jlong instance, jobject direct_buffer, jint offset, jint length) {
Expand Down

0 comments on commit 38d16be

Please sign in to comment.