From patchwork Mon Aug 28 17:03:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Steinar H. Gunderson" X-Patchwork-Id: 43379 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3822:b0:149:dfde:5c0a with SMTP id p34csp282733pzf; Mon, 28 Aug 2023 10:03:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGD3yti3+xOitNvvLyKFrKZPF0fAcblK2sGBz/n2QBcQbEMqhkNTBU3BwEi0Gm6RswxO+Hw X-Received: by 2002:a17:906:2219:b0:9a1:c3ae:b014 with SMTP id s25-20020a170906221900b009a1c3aeb014mr13035393ejs.20.1693242226523; Mon, 28 Aug 2023 10:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693242226; cv=none; d=google.com; s=arc-20160816; b=HMW0yiBv30X1wjs39/TKOYCBG75kIbcgU6Re+timFsfzM1FdtM3LO4gYVSJKtWV/Q3 VAL6g39qtEBsD4Khor1EkeyA2skQ+HkEc0gCwxcpnlnM8aOKlUBwhPkO+lUuviKNTTfU nnMij+VCWS2T8ulIVNES50vaTYWJfdmiG0LdJwyGziS2kf6F22Wh91E9bWAnbFM/EDIj FU3cBDSjL/dG9+cczCzWCPTUNsag8oXZ+hDZ/WPGPSm8mVEoFZdn/erKW99zCtZI3Vqk qSZuSYZg5d+BxfEW584dO5S6KNh1+BOW+gUoB37L/DuhVeZKHL8urXwaWVZ0GFnMoaMt 1VLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=u70mCyPX/VuRbdxed9lCGTwhnDnsYvZKaHjdDbpsmTw=; fh=IbWI4DM9erxKajZBwY2W570OyU15dGQTSVkQZPPh6d4=; b=02sQXE031NPtOe+t/kNAtJP6hLjiWHzrNUtP/TkBE4g53nr2Jgc2cZ+fNK3DDLSFYY WMsoJH5k0TfH0VpujHF4gV8kHAd1nIzw03WnqQydvpuaqarJhBtsl0Q6g/5Ic+Lc9rwG OueaUx4IgvO8PkhHnw2vJ8geqQ+8v9GDlyQzCZz6jVurCrHQK7I1tE6GcLducQmkXXJD 7fZ5eRPDoKMd5zYKW/jg6nRDAPY7ZI6K1rVeZZpVOh7E0OR+NyaSjaY8l0SbekeNbJml /uudWIL8Siyqo3NTUX052t6KNfc+RrsOVhTiwJiqxOJ/jN7jMg+IaxS6gjOTubjkEpQB 8L9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gunderson.no header.s=legacy header.b=yXQezDh+; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u5-20020a17090626c500b009a1bb8f4272si4522475ejc.581.2023.08.28.10.03.22; Mon, 28 Aug 2023 10:03:46 -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=@gunderson.no header.s=legacy header.b=yXQezDh+; 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 BE7A368C618; Mon, 28 Aug 2023 20:03:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from pannekake.samfundet.no (pannekake.samfundet.no [193.35.52.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D83468C28D for ; Mon, 28 Aug 2023 20:03:12 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gunderson.no; s=legacy; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QhovLbdEPe0KF9KD9UzBaAR5GU61RrpHEGb3XtmMq6w=; b=yXQezDh++Z/AVvk8GQv2YZx1uH Y/WxshVOy6ENjJkJQTBMk5OzPMynu97jYRWJB8biV7+Bh9vAQMCMbQVr7g6JCc4hxgwxR+8ghg+JB IHHOLodVA+YL3/t6gEtNKOscnRRut35Is1jveQVU2HR9ZFElHHUWXcwFDZizF/o73uCZhvoi4DaP6 8v7mzPi0Qce3UyrBuaR75d/L6eXuPvWXMV89B2W2gsYjitxs1pTR8bYNwlVtUD+0ev67V9aPcm6qT tVtvf0yHKP0yteb4ANgrdU0bsgLeB2w9yPvN0dqS2XjhZwK5reJSwCM7btNNfHj+I5liSuC0g3Vul dS38TkYQ==; Received: from sesse by pannekake.samfundet.no with local (Exim 4.96) (envelope-from ) id 1qafdu-000V7W-2a; Mon, 28 Aug 2023 19:03:10 +0200 From: "Steinar H. Gunderson" To: ffmpeg-devel@ffmpeg.org Date: Mon, 28 Aug 2023 19:03:08 +0200 Message-Id: <20230828170308.119613-1-steinar+ffmpeg@gunderson.no> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/matroskaenc: Fix writing of markers 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: "Steinar H. Gunderson" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: RNeAwcyZeBHv When the marker writing code was merged from libav to FFmpeg in dc62016c, it failed to take into account that the meaning of cluster_pos had changed in bda5b662; in particular, the special value for “I'm not currently working on a cluster” had changed from 0 to -1. This makes the avio_write_marker() call never be called. Update the if statement to fix it. Fixes: Ticket9843 Signed-off-by: Steinar H. Gunderson --- libavformat/matroskaenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index e813ef86cf7..1dfcf763e2d 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -3027,7 +3027,7 @@ static int mkv_write_packet(AVFormatContext *s, const AVPacket *pkt) } } - if (!mkv->cluster_pos) + if (mkv->cluster_pos == -1) avio_write_marker(s->pb, av_rescale_q(pkt->dts, s->streams[pkt->stream_index]->time_base, AV_TIME_BASE_Q), keyframe && (mkv->have_video ? codec_type == AVMEDIA_TYPE_VIDEO : 1) ? AVIO_DATA_MARKER_SYNC_POINT : AVIO_DATA_MARKER_BOUNDARY_POINT);