From patchwork Fri Mar 13 23:32:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 18181 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 9FD5C44B50A for ; Sat, 14 Mar 2020 01:33:53 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7BDD368B30B; Sat, 14 Mar 2020 01:33:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DDA0168B2FB for ; Sat, 14 Mar 2020 01:33:46 +0200 (EET) Received: by mail-wm1-f66.google.com with SMTP id 11so11629363wmo.2 for ; Fri, 13 Mar 2020 16:33:46 -0700 (PDT) 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=r93w8c8d3Ni/Z+QWNTqve7O+Q+8/IMBRWr/4KClUvsM=; b=cEhtx4iaJqU/T09fs6/ezC6UUhBExUON08OCybxSmLrV8kvhq1Zs9ru0Zs05VYOy7x 9++R2RZUnG0Z2Loims5yHLkJS+QNp4GV2LIwlqCcv0p0TOzlRjHYIMcoMp2K2GEYT+MT gSaFOxHjkeS1gW6EmUVV1xU8enQGym6QuTf+42Cigg82oZXG49JyRuh2h2kAUENxLI1e XPuk4QvGKmKdiKdV3IxPnNG6pzdrraQIZVFjqnBl2kKcTKcW9w00IXJlbF+BPV/WXhU1 1RH6zHSp+33veXVnyyejjrTyq9DxhTgV/B9ul5f2sNqBHGyRNsd1DCsl8UZGpdSi/bcN iILQ== 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=r93w8c8d3Ni/Z+QWNTqve7O+Q+8/IMBRWr/4KClUvsM=; b=nk7sEeDUtByt7EC7eXElbLNunn5qFeTbsKNbDyiBynclZlpKk9+OhwJI+N1e8B0ZEM t8fCEKX5d3PIYVa4cdLTEVyUuzJPOjrHrUeeKD0Mg0BPrHHl3Jcpho1Ezvdh+amOFOm9 fk2gSxRcLiQNR/u4UIJnwEKROIgcLygFGYfM8OV6YFB0iK1oujovHSvjVc/kBjPrVZIy 2q8b+RCFUmwaUVTnPC2veuHAnpfy7GW13xKmkwLRJgpuE5EMFg8KayTWtcI0Zs0BYhqu hpda+7MXCx2EcK7PmtlGsi+GciGGaBDNPwRKjKH3A2781tUeeEOszsq5sxbcAKTELdGK 83iw== X-Gm-Message-State: ANhLgQ2iiqyrWglTUXg+pqfnp5VXm+cetxXEwDCjkk9gnGNsWLDfQDle CDr907fYc/TmnqTxj5+1UdOa56+m X-Google-Smtp-Source: ADFU+vtT9hLgFsTvqw3BHDigOVoRV05ISgfViiClnPLDA8Pdz5vJ7SpIIXTUcvpHG4mIDYFg+ylMzw== X-Received: by 2002:a7b:c30a:: with SMTP id k10mr12790277wmj.20.1584142425949; Fri, 13 Mar 2020 16:33:45 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab4b.dynamic.kabel-deutschland.de. [188.193.171.75]) by smtp.gmail.com with ESMTPSA id p10sm17992666wru.4.2020.03.13.16.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2020 16:33:45 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 14 Mar 2020 00:32:26 +0100 Message-Id: <20200313233226.19858-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200302044445.14842-7-andreas.rheinhardt@gmail.com> References: <20200302044445.14842-7-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] 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 --- The difference to the previous version is that this version is not based upon my patch [1], so that the patches to webm_chunk are not blocked by it. [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2020-March/257844.html 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 d4b2eb6dff..30ba30e929 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; - ff_const59 AVOutputFormat *oformat; AVFormatContext *avf; } WebMChunkContext; static int chunk_mux_init(AVFormatContext *s) { WebMChunkContext *wc = s->priv_data; + ff_const59 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);