Changeset 4896


Ignore:
Timestamp:
Aug 20, 2014 12:38:43 PM (6 years ago)
Author:
riza
Message:

Misc (re #1751): fixed sound issue on Android L(using PJMEDIA_AUDIO_DEV_HAS_ANDROID_JNI), caused by the difference in JNI array handling. (Thanks Miguel Penades for the report).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-audiodev/android_jni_dev.c

    r4435 r4896  
    262262        goto on_return; 
    263263    } 
    264     buf = (*jni_env)->GetByteArrayElements(jni_env, inputBuffer, 0); 
    265264     
    266265    /* Start recording 
     
    297296        } 
    298297 
     298        buf = (*jni_env)->GetByteArrayElements(jni_env, inputBuffer, 0); 
    299299        frame.type = PJMEDIA_FRAME_TYPE_AUDIO; 
    300300        frame.size =  size; 
     
    304304 
    305305        status = (*stream->rec_cb)(stream->user_data, &frame); 
     306        (*jni_env)->ReleaseByteArrayElements(jni_env, inputBuffer, buf, 
     307                                             JNI_ABORT); 
    306308 
    307309        stream->rec_timestamp.u64 += stream->param.samples_per_frame / 
     
    309311    } 
    310312 
    311     (*jni_env)->ReleaseByteArrayElements(jni_env, inputBuffer, buf, 0); 
    312313    (*jni_env)->DeleteLocalRef(jni_env, inputBuffer); 
    313314     
     
    391392            pj_bzero(frame.buf, frame.size); 
    392393         
     394        (*jni_env)->ReleaseByteArrayElements(jni_env, outputBuffer, buf, 
     395                                             JNI_COMMIT); 
     396 
    393397        /* Write to the device output. */ 
    394398        bytesWritten = (*jni_env)->CallIntMethod(jni_env, stream->track, 
Note: See TracChangeset for help on using the changeset viewer.