From patchwork Mon Mar 2 04:44:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 18000 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 6B45F449CCD for ; Mon, 2 Mar 2020 06:45:11 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 59CA568B480; Mon, 2 Mar 2020 06:45:11 +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 58F4168B458 for ; Mon, 2 Mar 2020 06:45:02 +0200 (EET) Received: by mail-wr1-f67.google.com with SMTP id l5so10777552wrx.4 for ; Sun, 01 Mar 2020 20:45:02 -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=J/R9llcQtnQxWLsEhE7oBDjzYjr/gvxeGzXilEs4CE0=; b=TlpQ+GX8WVoN7JSx9+F2nlEktsgPjWJYgcEz0s7anGJfypxjkMFGnzy9h3j/7S7WhT iIec3XwiL7k9M3panVxQihvMqveFUNg/4NOc0NBci7OOpIA4quhgtXSxdG5riKSSOWl/ qw6hgjYyz3GDPQPYjZggJi6xQMWG7BET7NHCUXnxUDzeNmrKddy1bN0FH4FnrkdmMsBq HwCkcSzaQ9tl/kdFMy50RdXOTNeWpAt7QWcKHQLyi1nK6viNs6Ra6RF1b/FzQmkFtZiR VAYPPJW5Diq1VJfPgQS98Ru3hjE/tkRdNqNVX/vjMvf/g+h5JE2KcXgIzSZgMWtdRBdf hikw== 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=J/R9llcQtnQxWLsEhE7oBDjzYjr/gvxeGzXilEs4CE0=; b=UkMreycvHXEV2hMGOhPeK1OB0BtMOrtEP/xF/mwVjqKKcuCDo8z+tN8YNnYNANzCNh 4S/lFyrd0q4tZQJeUvV46uBbU+1uw3SiGPeHIxrpAoGf2QgurlD5pma+TxT+iByi8n6P s8Gd8BRVdOQ13m2IhUAMqof5r8P4PoLaz5pgG42G2CjbWdhHBf/ck//Duh7gqzch6TDA zMitugHwxuOkiLvaqbd2gJ24ELP9D8vmZ8GOaTzU8E9/Qmgdu89RFDIy/d9m4tg1rxql qQTqMlu/XAmOJ21VS8G2lNZxeM4Kf7tb2uxAEWGwFadokj4TO1AHzgEJL7IhSfmnCEI9 DYTg== X-Gm-Message-State: APjAAAWw+VI2llb7k8ybrkq3fVxSNdyLaEmov7AOZjI+ywr0a/E3Yc4+ RxiBvuQFkUu53SKNqPcbWeMa7Epv X-Google-Smtp-Source: APXvYqzxZQgVfbrWuQmnKbqDRMuVJWwv8ruF6hBNWgbnxSILt2gt4/Thou/u7vFZ6T0hqjvXc9c6YA== X-Received: by 2002:a5d:494a:: with SMTP id r10mr19705646wrs.21.1583124301614; Sun, 01 Mar 2020 20:45:01 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1ab4b.dynamic.kabel-deutschland.de. [188.193.171.75]) by smtp.gmail.com with ESMTPSA id s22sm13130229wmc.16.2020.03.01.20.45.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2020 20:45:01 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Mar 2020 05:44:39 +0100 Message-Id: <20200302044445.14842-7-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200302043520.14165-1-andreas.rheinhardt@gmail.com> References: <20200302043520.14165-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 11/17] avformat/webm_chunk: Don't keep pointer to AVOutputFormat 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" It is no longer needed given that the function pointers of the child muxer's AVOutputFormat are no longer called directly. Signed-off-by: Andreas Rheinhardt --- libavformat/webm_chunk.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c index 3beb267458..d1b016bb14 100644 --- a/libavformat/webm_chunk.c +++ b/libavformat/webm_chunk.c @@ -53,19 +53,23 @@ typedef struct WebMChunkContext { char *http_method; uint64_t duration_written; int64_t prev_pts; - const AVOutputFormat *oformat; AVFormatContext *avf; } WebMChunkContext; static int chunk_mux_init(AVFormatContext *s) { WebMChunkContext *wc = s->priv_data; + const AVOutputFormat *oformat; AVFormatContext *oc; AVStream *st, *ost = s->streams[0]; AVDictionary *dict = NULL; int ret; - ret = avformat_alloc_output_context2(&wc->avf, wc->oformat, NULL, NULL); + oformat = av_guess_format("webm", s->url, "video/webm"); + if (!oformat) + return AVERROR_MUXER_NOT_FOUND; + + ret = avformat_alloc_output_context2(&wc->avf, oformat, NULL, NULL); if (ret < 0) return ret; oc = wc->avf; @@ -156,9 +160,6 @@ static int webm_chunk_write_header(AVFormatContext *s) if (s->nb_streams != 1) { return AVERROR_INVALIDDATA; } wc->chunk_index = wc->chunk_start_index; - wc->oformat = av_guess_format("webm", s->url, "video/webm"); - if (!wc->oformat) - return AVERROR_MUXER_NOT_FOUND; wc->prev_pts = AV_NOPTS_VALUE; ret = chunk_mux_init(s);