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 7DF4A4AFE8 for ; Wed, 26 Jun 2024 10:57:57 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EFA7468D591; Wed, 26 Jun 2024 13:57:47 +0300 (EEST) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D510668D3FA for ; Wed, 26 Jun 2024 13:57:40 +0300 (EEST) Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2ec52fbb50cso43208051fa.2 for ; Wed, 26 Jun 2024 03:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1719399460; x=1720004260; 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=TDHOmNIhjIPZ2gkoAT2kSOVR8q544NnBulq+vKsdZ99UGKWSIBdVmBb4NilPB1NWAb YSfJbVFDwliFfZQSV8+PLFaMf3iXvVeIBXtPwZlenpr+9sureTAbvlgjUX0STDjJVSps tTCs24rbM0+eXW7hoOpmu/SeJS4sFoHxAtu4fU7OdJ8zLynSlRsACuA61apBCauujpmQ yoPMpDFUvaGUMEt1SPtEkB2RakLp+Tv3kwURRpiZ/t5cFm6DMsr1obFKJh/2EGlIk5+P 45mO3dzCJW2pcRz6GEtlzBmtjXItCMAIn1DgEvhDt5ApPV9H3vuJR1ZwPY2pnrWoKEkg RluQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719399460; x=1720004260; 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=FQ0YZx13VyN2KDO3LDX9idY+mY5PRlhZg8eiqhR2jKL/JubN3wy8ZF17jegUgDI7Nq qLiqsXtqMLQzRxguGtbuDRT4QcFZ+4cxP7+Zsg6MQs9H1K4pFOIK0tQGcc9MAeLWPSae yb3NjKzsRizvFc/TwB+6+oAzo799sqfijaznQqiPQkzdfRVSKdTViCQGzQ3CU+SJr4z2 1QXO/unSMzL4C1iRphGT1PDqhCoIsfwaQipZxx5gedsmARNIi5V3Hek6kY0aRflvTfZQ kO30EiD4X3D1uqHSGfFE+Z9ghtGH5GiQueGvc62odp4n+rrqReYaXxCWDHhehWpnb1V9 Oz0A== X-Gm-Message-State: AOJu0Yyf8PHIBN8hpLBwoo5RhwfTUTBYLK5jm+0pFVtDXsGqSVUCbC1u MgvjwHlGXHxe6bF/ZLXcXpL8kxVx3SQfbdn30fxNsQwIUYRy293oq7aJ9CA8GtfeW2tEZDUXKg8 YDw== X-Google-Smtp-Source: AGHT+IERZLmYtRvgf51cT5rNMdPN8UNp7YkxhJyG68szRuE59ADIXt2wUkq0khmRKQObt3MlfRmZfg== X-Received: by 2002:a2e:8792:0:b0:2ec:4eca:748b with SMTP id 38308e7fff4ca-2ec5b2a011dmr55304001fa.14.1719399459820; Wed, 26 Jun 2024 03:57:39 -0700 (PDT) Received: from localhost (host-114-191.parnet.fi. [77.234.114.191]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2ec520fc3b9sm12390621fa.114.2024.06.26.03.57.39 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 26 Jun 2024 03:57:39 -0700 (PDT) From: =?UTF-8?q?Martin=20Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 26 Jun 2024 13:57:35 +0300 Message-Id: <20240626105738.58427-2-martin@martin.st> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20240626105738.58427-1-martin@martin.st> References: <20240626105738.58427-1-martin@martin.st> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 2/5] 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: Steven Liu 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".