From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 738834A92D for ; Mon, 24 Jun 2024 08:50:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6427868D62F; Mon, 24 Jun 2024 11:49:54 +0300 (EEST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5024B68C0EB for ; Mon, 24 Jun 2024 11:49:46 +0300 (EEST) Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-52cd8897c73so2723110e87.2 for ; Mon, 24 Jun 2024 01:49:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1719218985; x=1719823785; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vY/mloxkuJevoJgPsdQohyCFyuLtyKYhXRL2Brwy7WA=; b=wd7iSyN4gP9WSOt1suLaZ+OvnmnuKOY8fehjlTSchMiobOPsKmsc4xS1xXHJjtx5to uaiIVeswLp0HvcCu47YnY0AcEnJoxtboGB6R45D2eGF2lvg8OyLnqhkn+aT85A3XI/6/ CedWbO/rVtlBeXnItivy3zUCb6qTGKI/PAv9wD1zaW1kEvLvSBvD2Ff9G9IZKkHGANvd qMKmoVOIkM8D5bjDa551Mvuec1B3uhb4TChQ4Ij1ogvyE5YY5I4+FBxutGLhqUAIuKQa 8Hf8vFbBTs/YyuqEn/phvwl0MAjWfeqG5lWVhuX1Pt66UUy+8Lp5PlDRoEFumGhY2ttY VIkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719218985; x=1719823785; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vY/mloxkuJevoJgPsdQohyCFyuLtyKYhXRL2Brwy7WA=; b=X4j0eig1gZPVLKHYq6PDsbEsItQbGRJ49QVIG4OxCUawdgKETTJcN/vz6ZjtyZ51TW ZxcnKXSzuCqvhSdgknLEA/ET4T7TcSXzKKs4jOSCAluSYHou7bJrZny2UrmwObc8ZNAw g3SaXKAUyA3/YgElfrbzzkNGHk0FIZmKtCqsoVs0LL35gI6jmhg3zoENCFsweQRsGTV0 L3Ab6J0y0Iw49O38+B/0oDM07sfOQR8ck9gjDHpYpDFq0D/4J3+0pPNLsAEuxm4mwL3Z SGqRl+5+81rnyD0/OikoQ3mO3qySjJxVpsDYI1T8BXJI9b+HoN2Fz1rjp4REpUAq59R9 BMhg== X-Gm-Message-State: AOJu0YySXse/vrqwYsK244TxFR1IALlHS0Q2+4dtANoObm3gV61LPmKr nnb+Ta16bFWRBmddzYPL8VjlYBi5cDEsnd9E57wGEmrQGVoYkW6DxenVdh5FH28LPc0ablVg3pX TDA== X-Google-Smtp-Source: AGHT+IHObRHZQccgm53CQ9SPajCLmNEogPKobFcrg+ZUW0L8u2WGDMo5IpV3R3WLSLUhs2zMYlmlJQ== X-Received: by 2002:a05:6512:3605:b0:52c:dfa7:53a2 with SMTP id 2adb3069b0e04-52ce185f761mr1650906e87.50.1719218985414; Mon, 24 Jun 2024 01:49:45 -0700 (PDT) Received: from localhost (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52cd63b4785sm939277e87.15.2024.06.24.01.49.45 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 24 Jun 2024 01:49:45 -0700 (PDT) From: =?UTF-8?q?Martin=20Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Jun 2024 11:49:42 +0300 Message-Id: <20240624084944.14276-2-martin@martin.st> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20240624084944.14276-1-martin@martin.st> References: <20240624084944.14276-1-martin@martin.st> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/4] hlsenc: Fix setting vs->start_pos when not using HLS_SINGLE_FILE or hls_segment_size 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: lq@chinaffmpeg.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: When not using HLS_SINGLE_FILE or hls_segment_size, we're writing each segment into a separate file. In that case, the file start pos for each segment will be zero. This matches the case in (hls->max_seg_size > 0) above, where we decide to switch to a new file. This fixes the calculation of "vs->size = new_start_pos - vs->start_pos" at the start of hls_write_packet; previously, start_pos would refer to the byte size of the previous segment file, giving vs->size entirely bogus values here. --- libavformat/hlsenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 3d5eb47e84..0c72774e29 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2659,7 +2659,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) vs->start_pos = new_start_pos; } } else { - vs->start_pos = new_start_pos; + vs->start_pos = 0; sls_flag_file_rename(hls, vs, old_filename); ret = hls_start(s, vs); } -- 2.39.3 (Apple Git-146) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".