From af5c035e4348393c299f8cb687eebd3fa5b55ecb Mon Sep 17 00:00:00 2001 From: magjed Date: Fri, 14 Aug 2015 02:42:15 -0700 Subject: [PATCH] VideoCapturerAndroid: Release queued camera frames when stopCapture() is called BUG=webrtc:4892 Review URL: https://codereview.webrtc.org/1285823002 Cr-Commit-Position: refs/heads/master@{#9709} --- talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java b/talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java index 25ed3f7b76..dee414673c 100644 --- a/talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java +++ b/talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java @@ -898,6 +898,8 @@ public class VideoCapturerAndroid extends VideoCapturer implements PreviewCallba void stopReturnBuffersToCamera() { this.camera = null; + queuedBuffers.clear(); + // Frames in |pendingBuffers| need to be kept alive until they are returned. Log.d(TAG, "stopReturnBuffersToCamera called." + (pendingBuffers.isEmpty() ? " All buffers have been returned."