Merge "Test for non-null AudioTrack() object in android_media_AudioTrack_setOutputDevice()." into mnc-dev

This commit is contained in:
Paul McLean
2015-05-21 16:21:47 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 1 deletions

View File

@@ -623,7 +623,7 @@ static jboolean android_media_AudioRecord_setInputDevice(
sp<AudioRecord> lpRecorder = getAudioRecord(env, thiz);
if (lpRecorder == 0) {
return 0;
return false;
}
return lpRecorder->setInputDevice(device_id) == NO_ERROR;
}

View File

@@ -998,6 +998,9 @@ static jboolean android_media_AudioTrack_setOutputDevice(
JNIEnv *env, jobject thiz, jint device_id) {
sp<AudioTrack> lpTrack = getAudioTrack(env, thiz);
if (lpTrack == 0) {
return false;
}
return lpTrack->setOutputDevice(device_id) == NO_ERROR;
}