From patchwork Mon Aug 12 02:16:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 50990 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:1ff2:b0:489:2eb3:e4c4 with SMTP id ks18csp1098370vqb; Sun, 11 Aug 2024 19:16:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUBtjQ4rRoqzn1KZyT9JCsBCMTW8ltat9lDniGNw/NX7p04uE+zh+XWxyxEyhINirPhJNodLLZXIpamDedMALtuj879OCXFghLwmw== X-Google-Smtp-Source: AGHT+IF1w8gPSPp+FXzRVpYvT7d+jv/ZVvvE8MZo3eGNow+vBm//htw1hBm2FWIZaXqkJUcKSG8Y X-Received: by 2002:a17:907:7287:b0:a77:cc6f:e791 with SMTP id a640c23a62f3a-a80aa5eb176mr609739066b.38.1723429007102; Sun, 11 Aug 2024 19:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723429007; cv=none; d=google.com; s=arc-20160816; b=0opNNDY0h1jazJRz+gsJaIYviOV98R9xVuIorZwJ69Abc3DlrCYPabTJzfJ7gnr1vs h7aGVJW5Wz8BVXZny0YfIMOBRk9GTJ/zvilDTzq7kE0OCvziT06VckcDsoVWERENlg+K OwYrLVkGzLnH5vEd+jFvdSBmwvbvATLtQqFF6/GCOAhHZF/CUwPTNcOzRgRAgMyPNzGa uP5itHQUI2FanAgNLUjmebY9ht9g/GnwKzR9viztAM61Xj7AFW30TZ2CtRu1RogVKcx9 eb8cJR6YKgCNOblZvJDa3SzDxwnkBxAyCveRdfoc4PsVE2Axg/Jqin3rXex0mJIOkkZg WxgA== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=rf/3ejwtqNFl9hk2+fN8AjcLEdFXYqnn1qe8joi0G4A=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=oA2IuJSCMsAWvytzq/CyAMapzpetqTKeO1JqMNor8urf5mq8uiBTwRV1hMKWyAvJYi 1EpB1HtasIKgJInCEEHtcaxTnL1XnY8vqCrW7neUOs2+WBYCdk/BLChNAV7r9BmeiOLB KOgtwJFl2lEAMZ8886lygEBsnhuroeYuEoi18o+bbftQFPAwD+mIR/c8HQv6CfoOLUDn vwgw73V7W1p8ZHnDk0lajveGxgT5JoRjZUC3CA2GqXGVIgnV2FFAWSK06t2uw6wqiQxC 6vDnNnksc7xFjT59siCjcwHi0uQogPwglBJEnXj1ArWFpWKRor//l0sGDLzRiUOhgy9B TCKw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=j79i9XeR; 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; dara=fail header.i=@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 a640c23a62f3a-a80bb342247si240038566b.796.2024.08.11.19.16.46; Sun, 11 Aug 2024 19:16:47 -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=@gmail.com header.s=20230601 header.b=j79i9XeR; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3D6A768DA7D; Mon, 12 Aug 2024 05:16:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B679C68DA6B for ; Mon, 12 Aug 2024 05:16:37 +0300 (EEST) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1fd65aaac27so32371515ad.1 for ; Sun, 11 Aug 2024 19:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723428995; x=1724033795; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=7+DEYe79e9HD8eUVNtcCMBSZbvHouweK+kkKrEjdi/Y=; b=j79i9XeRbYyB7ckSwk/w5f5oJuEjlAxTZ03fYivOed/P9dGpgZ14rDaLvyT2DZi1Bx yyaZ59/r+O0RLttElZ+1YdsbM/udpngXz3+ulrPGgmzV81gcAN45R0qtoCWERlG9nT6N BO8/39P42FyL31bGKFe3GyiSzYvb1Lt47crkDBPJD7aZKczQL2X1yhHJNnwWzQY1tcvt hKnxJaJkhH4RvT/3JD79GNU/BfBsf7R8JM5C1uQhJBYGQvx62d8615RtIjR0y9VRJ7G/ vmHaBu6raC0dNMUm3GFUSf2dOgkBEwksyvmfGLWoRl1De3fX28aso6Yis+F+KMA4mLSe TjfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723428995; x=1724033795; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7+DEYe79e9HD8eUVNtcCMBSZbvHouweK+kkKrEjdi/Y=; b=KYhhV2ZuT3PoDzROej8I3kWuY4JfCZcIfaIOXDk97OOKH2KdFkuFJPCb8iXHWiH14i UbEKdvv9+RIjzSHEJouZg/wuj/0xWLhqOMD9uXvAAtVm4ZRf3QbUSsmuRoD8mW17Yvt+ 4cJl37gfhsdTl+xJO8GwrmZbMXNjQ9SypquD42Icw/ibQPHtbSg2UtGJ66YEIyerjhWn gqbBlRG2jk5QLnPLb4SM73sf2zIhLnuygCdnwhNl6Vbc6wsrL/JDfBPmpFwfjiFMJhuL fFFx2/ykhxDdVG6RCSozU5rTtgdR7TqBEpT/FiqbqPuzkUuP2AvLySB8zU93cnnE+/Dq /VFQ== X-Gm-Message-State: AOJu0YygOVtWx18cDfU47ZVF/r5uv0417W66PLihc4lWtE5gv9gJr6Cl swpEs8MNtNl/273Oj0AK++08ujP+LfvUbEoW9UgYJ2cOmCPjFRUS6ZXYww== X-Received: by 2002:a17:902:ea01:b0:1fb:8e29:621f with SMTP id d9443c01a7336-200ae567dd3mr125713625ad.16.1723428994784; Sun, 11 Aug 2024 19:16:34 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-200bb9038fesm27733385ad.114.2024.08.11.19.16.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Aug 2024 19:16:34 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sun, 11 Aug 2024 23:16:25 -0300 Message-ID: <20240812021625.799-1-jamrial@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/movenc: don't look at previous track_id as it may not be set 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: hG+uuIHvQWrB Signed-off-by: James Almer --- libavformat/movenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 8d91059081..d20e45cf81 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4952,7 +4952,7 @@ static int mov_setup_track_ids(MOVMuxContext *mov, AVFormatContext *s) last_track_id = mov->tracks[i].track_id = (mov->tracks[i].st ? FFMAX(mov->tracks[i].st->index, last_track_id) - : FFMAX((i ? mov->tracks[i - 1].track_id : i), last_track_id)) + 1; + : FFMAX(i, last_track_id)) + 1; } }