From patchwork Mon Dec 7 10:08:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 24421 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:c00a:0:0:0:0:0 with SMTP id c10csp2488564ybf; Mon, 7 Dec 2020 02:15:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzB1c//BjhBB9nWxXxGB64vcwUUgFP7/GhmxOUUQ2jRuQADAHjEhsEKd41Ibr60L50eUgug X-Received: by 2002:adf:81a2:: with SMTP id 31mr5905712wra.381.1607336142263; Mon, 07 Dec 2020 02:15:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607336142; cv=none; d=google.com; s=arc-20160816; b=v7SJGv/yFU2GpdITFiVtwnCpjE1NN4+FUHcdkCTa/1kBOk/5qD7WfW9VzwjW0CWuPJ BipA77rV/16bCpPdndLoUsnj8i8EaC7/d2nfI3Rd4i0Zhty031SSLDeX2gcmg86Fe5Zb dAXrwqXND//vpyr6nWMpaxKZpk3jWILKVeGlAPb8/7nx33h0ZYU4Gn7SixC3S7weAg3A Pgxm8FLC6573F6Oc2it8E2KY5tFiTm6365aJqay3Ka36bgk+FaHV5/RcA+Aolu49gFOY tgSV31udCGwf2TY5DnPkNlZWii63pQ3VG2WSVxIYeBR6FYjL+ArGzwks3B4fthOgWy3Z 3bJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=ltZ4onsWZmJeqqBXz5ZeaAqj3qTQGNCs22oECs2ukCY=; b=W8cIT7GuVYDmBv/ymXjzY0dlHuAlLztkOfNEqEe8cP7esAs7xM4JskLHQCGDo3PQoY BbI2a2+F9kFxu029LBXOAS9tHc2Ok8u0N038VEWicCaVZmA/NQaXByjMAYZO/DcPrQWD gyYNGxGNviarjLDbixU0AsHidUUxCGy80jvpXd0kYf2Ro4Y0XlqpQNi/8el99JOWhuWe l4aikhpXAPQeCg32f/J4sh4O2Xe5Vzh1jgP7vMjrBNN9X7L02Li97AtMz58Upq5pmnru o4NTy3r0jqqRwYgnL/ot9ZMcDaAVeLd1adEeLH4L9Av34BvozzrxeanrwEhNtmtXV1g3 e9Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=I2jSdT0z; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4si10865342wrl.90.2020.12.07.02.15.41; Mon, 07 Dec 2020 02:15:42 -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=@gmail.com header.s=20161025 header.b=I2jSdT0z; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 205DC689B32; Mon, 7 Dec 2020 12:15:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D25A66809D2 for ; Mon, 7 Dec 2020 12:15:34 +0200 (EET) Received: by mail-lf1-f68.google.com with SMTP id u19so17258014lfr.7 for ; Mon, 07 Dec 2020 02:15:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=MmjPQQdGze+Wmau/c/SiJ+Hq9tXkpBUAkWyTsT2fwS8=; b=I2jSdT0zHrifK9hGnfmVnDQxcVeFj39IElik1xl92ItMVeHJQwU9X/ibZHZpTNP+g/ kT/f5phPLGIavGJ3P9LY3UGBZfvC1bSJT2qVUcpix+GZPs+pRPGTMmpwg2LLvZQUZI8n kME/UPEaabhY4qDKKrxmXJWHMagwHlqpjhhBNwu1kUjMWBILP2eyaHcfjaIhRAd+bwfx MyCN38VfEaM8+SBSP3gVP/MCQvASFIFo4z+5ofpgtPLYSGHZy3Gr/kGfxiWcQb0pHoWA YE8uJzpm9vBtxjzWW0KiE2yCITgeRDVgRLgiozNz893FG1YmyC1ym9VQpdFWTcHOB/Jy u3RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MmjPQQdGze+Wmau/c/SiJ+Hq9tXkpBUAkWyTsT2fwS8=; b=r0XD+TQv2JT4q4OPoxhpO7ua/Atk4FCpEkmALsVyDp4iRzSv06RtyOxpOI2XedCTRo aIrfcH2eEELLNLk8Hes3ecV+K6uPhfwEqxVOv9OHPAMUPU0ukXYW0NOKyE9sAlUNeXk9 C/aJXDq9Zn2ZWONLimeAg0pYOcDJUmr7YM06cwbiog8cxXpLArb6XNh88pypgevB7Svp Vd4vPnazzqlXbpExu8/DcmXY4Tq3CPb0OP/UfzZekUt2RS3+0gXPDaxvVtVsLbJwY/KB K3qYgMavQ7v0Cs76aIsDNDUfY2ruXD9jjTjVBdpaib+EkGFSlTmEL9QpecgVVdph5eq1 WjfA== X-Gm-Message-State: AOAM530b7jpoe65XQ40ndGIphP6Ahe5bxf650m4CmXKqKWzut5ZXTDR1 4DAJPj3CHhpcO6raLSgeHZrONo85MvAIZA== X-Received: by 2002:a2e:9b4d:: with SMTP id o13mr405792ljj.163.1607335734103; Mon, 07 Dec 2020 02:08:54 -0800 (PST) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id v5sm45061ljj.135.2020.12.07.02.08.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 02:08:53 -0800 (PST) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 7 Dec 2020 12:08:45 +0200 Message-Id: <20201207100845.17520-6-jeebjp@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201207100845.17520-1-jeebjp@gmail.com> References: <20201207100845.17520-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/5] avformat/fifo: unset codec tag if unsupported by underlying muxer 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: iaMEIsKIZh4F Content-Length: 2233 From: Jan Ekström The API client has no visibility into the values provided by the underlying muxer, so we either do this always, or when an option is presented. In this case, we do it unconditionally, as this is probably more useful. Signed-off-by: Jan Ekström --- libavformat/fifo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libavformat/fifo.c b/libavformat/fifo.c index bc363e458cd..c9b782c2309 100644 --- a/libavformat/fifo.c +++ b/libavformat/fifo.c @@ -513,6 +513,18 @@ static int fifo_mux_init(AVFormatContext *avf, ff_const59 AVOutputFormat *oforma ret = ff_stream_encode_params_copy(st, avf->streams[i]); if (ret < 0) return ret; + + if ((st->codecpar->codec_tag && oformat->codec_tag) && + av_codec_get_id(oformat->codec_tag, st->codecpar->codec_tag) != st->codecpar->codec_id) { + av_log(avf, AV_LOG_ERROR, + "Codec tag '%s' is unsupported for codec %s in the %s muxer! " + "Unsetting codec tag so that auto-configuration can be " + "attempted.\n", + av_fourcc2str(st->codecpar->codec_tag), + avcodec_get_name(st->codecpar->codec_id), + avf2->oformat->name); + st->codecpar->codec_tag = 0; + } } return 0;