Index: webrtc/api/java/jni/peerconnection_jni.cc |
diff --git a/webrtc/api/java/jni/peerconnection_jni.cc b/webrtc/api/java/jni/peerconnection_jni.cc |
index cf3ddebde96c49b22b736a38b38e949a9175d6c2..9f64d01686b2795d2f0bafe51cc3eb55beb59b62 100644 |
--- a/webrtc/api/java/jni/peerconnection_jni.cc |
+++ b/webrtc/api/java/jni/peerconnection_jni.cc |
@@ -2046,9 +2046,7 @@ static bool JavaEncodingToJsepRtpEncodingParameters( |
if (!IsNull(jni, j_bitrate)) { |
int bitrate_value = jni->CallIntMethod(j_bitrate, int_value_id); |
CHECK_EXCEPTION(jni) << "error during CallIntMethod"; |
- encoding.max_bitrate_bps = bitrate_value; |
- } else { |
- encoding.max_bitrate_bps = kBitrateUnlimited; |
+ encoding.max_bitrate_bps = rtc::Optional<int>(bitrate_value); |
} |
encodings->push_back(encoding); |
} |
@@ -2106,9 +2104,9 @@ JOW(jobject, RtpSender_nativeGetParameters) |
CHECK_EXCEPTION(jni) << "error during NewObject"; |
jni->SetBooleanField(j_encoding_parameters, active_id, encoding.active); |
CHECK_EXCEPTION(jni) << "error during SetBooleanField"; |
- if (encoding.max_bitrate_bps > 0) { |
- jobject j_bitrate_value = |
- jni->NewObject(integer_class, integer_ctor, encoding.max_bitrate_bps); |
+ if (encoding.max_bitrate_bps) { |
+ jobject j_bitrate_value = jni->NewObject(integer_class, integer_ctor, |
+ *encoding.max_bitrate_bps); |
CHECK_EXCEPTION(jni) << "error during NewObject"; |
jni->SetObjectField(j_encoding_parameters, bitrate_id, j_bitrate_value); |
CHECK_EXCEPTION(jni) << "error during SetObjectField"; |