From patchwork Thu Dec 26 10:53:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 16967 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 420C8449EFF for ; Thu, 26 Dec 2019 12:54:17 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2AA4068A2CF; Thu, 26 Dec 2019 12:54:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C3E2F6881B7 for ; Thu, 26 Dec 2019 12:54:08 +0200 (EET) Received: by mail-wr1-f67.google.com with SMTP id d16so23341890wre.10 for ; Thu, 26 Dec 2019 02:54:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l5tXizcI7T87wiiQKC8pesitSkdmeBTJ4boi1uzg6No=; b=Z9X6Jbr8HiyVYlcKP9OAgWqD2QgEgWSXZAmu01sCNGhLYwxj76syUYvlyvIbbOqQM1 kfjhdOqXnXdOHyhEHm6f2LJ94UouJ48tpz9Pns4wpVxvsnNl8lnkMMEI9hOJ+mpf2Ont IHs0H3ftn8WtkTbvLrpR/G+KduNZ4SFOvmXfKGq9io/9G1UQ9506b+jUciRDZmb9IvBB fN7Iv2IMZ+c9d8ii1TOFKgScxty/jF9zQmi+MfOcIa+Dq50ztQXmIDEARPpP8U/p/0IR nMjf1Mi/jAbp2FJwQ3pyVJ12D3XDEYjnZwWbc9hgiXz2Mx4rkIRePPuBpck5kGbd3Uba CE4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l5tXizcI7T87wiiQKC8pesitSkdmeBTJ4boi1uzg6No=; b=BB8KOam59voWIvY+B2DMopzuEbrgOqlZ6MT0itwI/NLVkIEiahTIjF1lnyGmYwAWi4 sPC3gi7gnHpXuYcTZdzHtbgcmaf4rmIhOuZYHcD3t5NMq31qLPceCSCF9kpZNm79KO6Z A4o9v/52og+oMIHMuRMH7Af9D0buhCgcR0T58gBfHe+cTEI86zNw9PkDzoER3bT3ZL9l /EECKw6C6vb0dPY34HoHgDgp7KOIi+1HGQxed1F/8/SPYdv8Qs8EhtacX+Wf46nzE5Ve igl7gI8pYUSXab+aU8EeM2c2J3GgbjbO5NU4rpvkUKpFLoExtzjDrJjnIG+8zfMLRml7 2Amg== X-Gm-Message-State: APjAAAU8kYthgWZbICOx7VEwUPWWbPUhWW6ExQHond31edoNt1+3NIW+ GiNEQc3ONuZIzNTUpZ8C6CvVkXh4 X-Google-Smtp-Source: APXvYqxX2j8CaGNSztCAq8R2eBS5Vm57wAIimeTurrgcRF6j+hiaeWGAtM2tgyDwtTchXHemucGtPA== X-Received: by 2002:adf:f581:: with SMTP id f1mr45804229wro.264.1577357647881; Thu, 26 Dec 2019 02:54:07 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc10203.dynamic.kabel-deutschland.de. [188.193.2.3]) by smtp.gmail.com with ESMTPSA id c68sm7997618wme.13.2019.12.26.02.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2019 02:54:07 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Dec 2019 11:53:30 +0100 Message-Id: <20191226105342.11175-5-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191226105342.11175-1-andreas.rheinhardt@gmail.com> References: <20191226105342.11175-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/17] avformat/smoothstreaming: Don't write trailer of subcontext 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Nothing written in avformat_write_trailer() for the submuxers will be output anyway because the AVIOContexts used for actual output have been closed before the call. Writing the trailer of the subcontext has probably only been done in order to free the memory allocated by the submuxer. And this job has been taken over by the deinit functions. Signed-off-by: Andreas Rheinhardt --- libavformat/smoothstreamingenc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c index a5fd8a18db..07745d5cb5 100644 --- a/libavformat/smoothstreamingenc.c +++ b/libavformat/smoothstreamingenc.c @@ -49,7 +49,6 @@ typedef struct Fragment { typedef struct OutputStream { AVFormatContext *ctx; - int ctx_inited; char dirname[1024]; uint8_t iobuf[32768]; URLContext *out; // Current output stream where all output is written @@ -179,8 +178,6 @@ static void ism_free(AVFormatContext *s) ffurl_close(os->out2); ffurl_close(os->tail_out); os->out = os->out2 = os->tail_out = NULL; - if (os->ctx && os->ctx_inited) - av_write_trailer(os->ctx); if (os->ctx && os->ctx->pb) avio_context_free(&os->ctx->pb); avformat_free_context(os->ctx); @@ -363,7 +360,6 @@ static int ism_write_header(AVFormatContext *s) if (ret < 0) { goto fail; } - os->ctx_inited = 1; avio_flush(ctx->pb); s->streams[i]->time_base = st->time_base; if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {