Skip to content

Commit

Permalink
修复bug --git commit [0ae751e]
Browse files Browse the repository at this point in the history
  • Loading branch information
SundoggyNew committed Jan 17, 2024
1 parent 109f7d2 commit 99f86b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ijkmedia/ijkplayer/android/ijkplayer_jni.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,12 +1037,12 @@ static void message_loop_n(JNIEnv *env, IjkMediaPlayer *mp)
case FFP_MSG_PCM_DATA:
MPTRACE("FFP_MSG_PCM_DATA:\n",);
if (msg.obj) {
// 创建一个 byte[] 数组 长度msg.arg1
jbyteArray byteArray = (*env)->NewByteArray(env, msg.arg1);
// 创建一个 byte[] 数组 长度msg.arg2
jbyteArray byteArray = (*env)->NewByteArray(env, msg.arg2);
if (byteArray != NULL) {
// 将数据拷贝到 byte[] 数组中
(*env)->SetByteArrayRegion(env, byteArray, 0, msg.arg1, (jbyte *)msg.obj);
post_event2(env, weak_thiz, MEDIA_AUDIO_PCM_DATA, msg.arg1, 0, byteArray);
(*env)->SetByteArrayRegion(env, byteArray, 0, msg.arg2, (jbyte *)msg.obj);
post_event2(env, weak_thiz, MEDIA_AUDIO_PCM_DATA, msg.arg2, 0, byteArray);
J4A_DeleteLocalRef__p(env, &byteArray);
}
}
Expand Down

0 comments on commit 99f86b9

Please sign in to comment.