From patchwork Wed May 22 09:02:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Plowman X-Patchwork-Id: 49143 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp219115vqf; Wed, 22 May 2024 02:05:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX39Q2yenqDQeLhVqY8BStMmhvlduUZhCe4ApaTPS0hqNcn8JxgyJYyAaFry9fwUU8bkfkJ6SuCNom6DAEMoP8/9iBbM8iwfJIVow== X-Google-Smtp-Source: AGHT+IHm0Eskn0ksEKa59yA8y7HVWxMWY58ZdVGkTrRUCp3khcCsEt9D8mnDh48dyEUZpMjwh4r0 X-Received: by 2002:a50:8d49:0:b0:572:3483:8a27 with SMTP id 4fb4d7f45d1cf-57832c36d58mr1182652a12.33.1716368740324; Wed, 22 May 2024 02:05:40 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-574db0eae54si9877459a12.251.2024.05.22.02.05.39; Wed, 22 May 2024 02:05:40 -0700 (PDT) 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=@frankplowman.com header.s=zmail header.b=MRnwfbyg; arc=fail (body hash mismatch); 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BEF0A68D13B; Wed, 22 May 2024 12:05:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from sender-op-o11.zoho.eu (sender-op-o11.zoho.eu [136.143.169.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B3DE68D2EB for ; Wed, 22 May 2024 12:05:29 +0300 (EEST) Delivered-To: post@frankplowman.com ARC-Seal: i=1; a=rsa-sha256; t=1716368727; cv=none; d=zohomail.eu; s=zohoarc; b=ipCNTQIxceTlvuwyhx7loMKgWPYfKNp3GGUOLB6PJPVxmPQmKTpiOZLTZECA1n0FxbnCF7sU410wkTj7y2dAOEzICzl3n5PbPUXqhd0neuT8A0OS5OGRWnzbO6BJwzCUtt7VPEkbVyTyXi2iwlFfaM5md61HcMGQUxcSKHboeDc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1716368727; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=NxiNnJZatgmJ6Brhr2vySu8VSe62zgUHIQUdUM9zVSg=; b=HzqYEQJBhJjMbO2slOyK3bIKQ3pwhCo3L1C8af7ny+7ASVgc++GCTrbEFh0f4tIrFvZIpt+VLjQsCykywfpivdMJul/nclHB/um2H5M2UBjMs5JqOuu9dRxE1IdCdekqvXUIa/qA74bFWW2cTERNwDuRLgbK636Zi/B1TJvBtlM= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=frankplowman.com; spf=pass smtp.mailfrom=post@frankplowman.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1716368727; s=zmail; d=frankplowman.com; i=post@frankplowman.com; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To; bh=NxiNnJZatgmJ6Brhr2vySu8VSe62zgUHIQUdUM9zVSg=; b=MRnwfbygmZ/swhSBdXBKZxjtCrK0UyT2zltE6p2M4e0Q1CeX1AdRohO6cWlUPUD8 UV8iDX7HdQQw+uEkxi6tgtHbSrO289+EVzfokH+/f3lRY46Nx+O3znAWI5GydGpWM/D ygYw/P9KoViAIhoeVOT3tde50rq4BVzVYN0VJe38= Received: by mx.zoho.eu with SMTPS id 1716368724919340.98435776581823; Wed, 22 May 2024 11:05:24 +0200 (CEST) From: Frank Plowman To: ffmpeg-devel@ffmpeg.org Date: Wed, 22 May 2024 10:02:53 +0100 Message-ID: <20240522090513.55806-1-post@frankplowman.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-ZohoMailClient: External Subject: [FFmpeg-devel] [PATCH v2] lavf/dash: Forward strict flag to component demuxers X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Frank Plowman Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dlJa0kEdwKvW Before the patch, opening a DASH file containing streams which require experimental decoders was problematic. No matter where the -strict -2 was put on the command line, the option was not passed to the demuxer for that component. This resulted in an error, prompting the user to add the -strict -2 flag, which is already present. Decoding appeared to continue correctly however. Patch removes the error message by creating an options object for the demuxer created for the component, which inherits from the parent demuxer. Signed-off-by: Frank Plowman --- Changes since v1: Use nb_streams stream_info_opts, not just one. libavformat/dashdec.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 555e21bf69..9c5ef5801a 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -1911,13 +1911,28 @@ static int reopen_demux_for_component(AVFormatContext *s, struct representation if (ret < 0) goto fail; if (pls->n_fragments) { + AVDictionary **stream_info_opts; + + stream_info_opts = av_calloc(pls->ctx->nb_streams, sizeof(*stream_info_opts)); + if (!stream_info_opts) + goto fail; + #if FF_API_R_FRAME_RATE if (pls->framerate.den) { - for (i = 0; i < pls->ctx->nb_streams; i++) + for (i = 0; i < pls->ctx->nb_streams; i++) { pls->ctx->streams[i]->r_frame_rate = pls->framerate; + av_dict_set_int(&stream_info_opts[i], "strict", s->strict_std_compliance, 0); + } + } #endif - ret = avformat_find_stream_info(pls->ctx, NULL); + + ret = avformat_find_stream_info(pls->ctx, stream_info_opts); + + for (i = 0; i < pls->ctx->nb_streams; i++) + av_dict_free(&stream_info_opts[i]); + av_dict_free(stream_info_opts); + if (ret < 0) goto fail; }