From d48f56de1f06d62fcb46bb9f20bd5f336e80aae9 Mon Sep 17 00:00:00 2001 From: kthelgason Date: Fri, 4 Aug 2017 10:18:43 -0700 Subject: [PATCH] Destroy compression session instead of reset it on release. This will prevent one extra initialization of the encoder each time it's recreated. BUG=None Review-Url: https://codereview.webrtc.org/2992233002 Cr-Commit-Position: refs/heads/master@{#19250} --- webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.mm b/webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.mm index 2e87458fe8..2bac68ef6d 100644 --- a/webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.mm +++ b/webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.mm @@ -534,12 +534,12 @@ int H264VideoToolboxEncoder::SetRates(uint32_t new_bitrate_kbit, } int H264VideoToolboxEncoder::Release() { - // Need to reset so that the session is invalidated and won't use the + // Need to destroy so that the session is invalidated and won't use the // callback anymore. Do not remove callback until the session is invalidated // since async encoder callbacks can occur until invalidation. - int ret = ResetCompressionSession(); + DestroyCompressionSession(); callback_ = nullptr; - return ret; + return WEBRTC_VIDEO_CODEC_OK; } int H264VideoToolboxEncoder::ResetCompressionSession() {