Index: webrtc/sdk/android/src/jni/native_handle_impl.cc |
diff --git a/webrtc/sdk/android/src/jni/native_handle_impl.cc b/webrtc/sdk/android/src/jni/native_handle_impl.cc |
index e2f33b7c2bfe2fa1a7076c3d6e069435f30b3a50..907c90e092bcaa8dd6213bfaf1b722f67fe43ff6 100644 |
--- a/webrtc/sdk/android/src/jni/native_handle_impl.cc |
+++ b/webrtc/sdk/android/src/jni/native_handle_impl.cc |
@@ -189,10 +189,9 @@ rtc::scoped_refptr<webrtc::I420BufferInterface> AndroidTextureBuffer::ToI420() { |
uint8_t* u_data = y_data + height() * stride; |
uint8_t* v_data = u_data + stride/2; |
- rtc::scoped_refptr<webrtc::I420BufferInterface> copy = |
- new rtc::RefCountedObject<webrtc::WrappedI420Buffer>( |
- width(), height(), y_data, stride, u_data, stride, v_data, stride, |
- rtc::Bind(&webrtc::AlignedFree, yuv_data.release())); |
+ rtc::scoped_refptr<webrtc::I420BufferInterface> copy = webrtc::WrapI420Buffer( |
+ width(), height(), y_data, stride, u_data, stride, v_data, stride, |
+ rtc::Bind(&webrtc::AlignedFree, yuv_data.release())); |
JNIEnv* jni = AttachCurrentThreadIfNeeded(); |
ScopedLocalRefFrame local_ref_frame(jni); |