From patchwork Tue Jan 2 06:48:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jeyapal, Karthick" X-Patchwork-Id: 7068 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.79.195 with SMTP id r64csp14362196jad; Mon, 1 Jan 2018 22:48:44 -0800 (PST) X-Google-Smtp-Source: ACJfBosLL1bwHZ9bVF1mRHJlmdFq+p6i6Asv0jP3XgINGarqctDfVHAUJF9xq1W4KOX0nq0eaXex X-Received: by 10.223.163.197 with SMTP id m5mr35170157wrb.117.1514875724874; Mon, 01 Jan 2018 22:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514875724; cv=none; d=google.com; s=arc-20160816; b=WA2vqlWGWbr77mfoASdRMsrUywjR+ptGyKTr0M0A1vUnX7lG8PsY/dM3dVoS2dnou0 YDahzwXFleXhb1RCUgFCjJsUucNv/w6Cpkjr6+hluRorgW0afNcVW3FfhfjhxBSjpgPj a6GXhbvRW3XJXtc1/lqnibo37DTUTbowl/UEIWUh06eLNbetStRXreVNB6QBpWdwy5ZW syNfR5F43cfNijER9jEJg/sCj8vhdPJaOgqmFjZJJO3P5/AJP6sk4q2jO/YVr/JI5Zpj kFL/Vax7fJcheOWzZyFB2sk7/lEicwRlrWWqIYFOFzNzAn4bMySHexGSkyEWiAm0zuio m9Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:message-id:date:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=zhGc4U3PW1hrI5IOGgQA2kdo41FUXNKYQIp8G8XtV+8=; b=ixJ5oq30usu11NJbp81OuLcF+5JDNptbuOrkFzZRSH1tpQSurV1MurkMVUUqYalJfY rxi+qKfC8yI8+u+27jW2DWLxkiG0x/HA6CF9nu+y6U5tjqeNAzlm//O/YDI0q3PcY98Y mGccLZOn4kT4M+OY0t3Iqxu8h98J6SyyLFzW8dADq8tYyF1/iyYAaSKgobSPEAszEq74 Xi+E8mMs1eBfaFyoz5ewuYxYSbdPECrkR1MG4IBEZvxyWzSxFP2d+F/9Sj/7hxniZ5Kf MhHBUO2q9urUljRqdejxab0mry1FRnGRHtNVfrXcOSjB2zOXlwsw1ih5Rv3Qkvuk0mNs osTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=gFuhcdcD; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k184si20632741wmd.221.2018.01.01.22.48.43; Mon, 01 Jan 2018 22:48:44 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=gFuhcdcD; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 98F63680623; Tue, 2 Jan 2018 08:48:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a2i831.smtp2go.com (a2i831.smtp2go.com [103.47.207.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DBE6D6805C5 for ; Tue, 2 Jan 2018 08:48:19 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m78bu0.a1-4.dyn; x=1514876621; h=Feedback-ID: X-Smtpcorp-Track:Message-Id:Date:Subject:To:From:Reply-To:Sender: List-Unsubscribe; bh=ejWwYCvGMwZ9iXEuuc33JwX719XLbj+Sczb6KjOxHn4=; b=gFuhcdcD B9nHZ23YDaktUrRJ7+XK8QGDiKuw7sdg4rnFaT447mIvxSHwT9MDkj3DL7sAQ7A6ZSPJ4AL6c58tF 2ee1kmj/uE6wCdOVP/JuMBrfcz+5CoUvbvP9TGZndZX3rbCW/tf2PrrmqNYVxNzg7FP0UMxLD20w1 JtRg8PPGbWDFmJpHx5es41OwXxb/JFNyfLfLc88lDp90OT3zZRQpty8N2Dy/twyIodSoAafU4Scq2 Yp1oHns4axiR5oBiZVO7+l1NAvWS8wsk0tMqtPPL3Fts6sxkCiYw3mhIIe8MKJ9+GOZLzsL9xKsop tCq3SLPv3qR0BLMwqPql9sDXmg==; From: Karthick J To: ffmpeg-devel@ffmpeg.org Date: Tue, 2 Jan 2018 12:18:17 +0530 Message-Id: <1514875698-28017-1-git-send-email-kjeyapal@akamai.com> X-Mailer: git-send-email 1.9.1 X-Smtpcorp-Track: 1-WGND4ba88lju.S2sA25rMF Feedback-ID: 337386m:337386asVRLGB:337386stWhvZtiiD:SMTPCORP X-Report-Abuse: Please forward a copy of this message, including all headers, to Subject: [FFmpeg-devel] [PATCH 1/2] avformat/dashenc: Fix a resource leak when http persistent in enabled X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Karthick Jeyapal MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Karthick Jeyapal --- libavformat/dashenc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 3345b89..c4c112b 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -1,6 +1,7 @@ /* * MPEG-DASH ISO BMFF segmenter * Copyright (c) 2014 Martin Storsjo + * Copyright (c) 2018 Akamai Technologies, Inc. * * This file is part of FFmpeg. * @@ -1317,6 +1318,16 @@ static int dash_write_trailer(AVFormatContext *s) } dash_flush(s, 1, -1); + if (c->http_persistent) { + int i; + for (i = 0; i < s->nb_streams; i++) { + OutputStream *os = &c->streams[i]; + ff_format_io_close(s, &os->out); + } + ff_format_io_close(s, &c->mpd_out); + ff_format_io_close(s, &c->m3u8_out); + } + if (c->remove_at_exit) { char filename[1024]; int i;