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 7399F47E38 for ; Fri, 27 Oct 2023 21:36:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5C59C68CBAA; Sat, 28 Oct 2023 00:36:56 +0300 (EEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1BE1868C987 for ; Sat, 28 Oct 2023 00:36:50 +0300 (EEST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1c9d3a21f7aso21828275ad.2 for ; Fri, 27 Oct 2023 14:36:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698442608; x=1699047408; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ra0vv8mjkQPDGlUHSoWkF+ZodySYfOvbW3m4FhrYaSg=; b=OJBTLyrW8GaldJH0bydECelo3KV77ond29Ff8IuTW86CG4HhcuA3V6QhApIjGt+z88 QbifHJq9EVMwPmYId+Op/08JC0S+BgUWJzMUtx6IYKxIkYzBBTT74+UXjxAWRGq1nkZl 5hHoks3pawPcviOnmcUim9aJd/W+1D3ehCfdT++0QNVeke3sOTSccr/zMwIo4YiEDEAS OsKz2dTF+D/u50wmxB3SZz8C7Kffcou5+S3RNzXRmetNGhkNvhTOlQ7wrMPSswMEn5js GAMs+/1QOQfJ/w/7NOIv3QnGPKfS1KVHuu0wbqMW7n+Kc0eCxmRC4etjXjsv1yhvRJUu KBPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698442608; x=1699047408; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ra0vv8mjkQPDGlUHSoWkF+ZodySYfOvbW3m4FhrYaSg=; b=WgPKpneAZ5/qm9ER4FUOeN5Ow08Oy3b9TpfWN7XaO+D41F3tIoKVtfTOVV+IsrB9S9 t77DNQTZTrPWvPJOc3umcJ0B+hbdXznoXl8rfUCQPuVLp4okeW+qI5t01woZs9BHyNfN /wo67AxCIWeXPSxsgTF/+5VSyu0/OoPWchyuxsoMIyWTCVoI6v/3gyOar7K4YjBgdueA pqYae/PN1w3qy082Ba7P5xOq4Bt2Nz/is9SOpBSE/xJuTLZxa9MmaOvQNjwh1mNNI9RI BoYY3H5IHtagpxOIBb9z5lJr4RFZcd2t681BhXnLflLCDWRopZp9tDiHUDg5rnPq+0Li 5JHw== X-Gm-Message-State: AOJu0YwmfoUfZmt/CVSzaSg4RZiiPoFWUtIwS6v+47utmnjGuuFZ/eVN ZZlq3Xb0zY0b4wVTz/MXPnXMztGEDR0PJQ== X-Google-Smtp-Source: AGHT+IEBEctNrQgQ6riR6EF6r2+PujFnAiSgY2h3UwAYvNr0kws/8H/VAIv7Z2zYVC8XntjYZMznrQ== X-Received: by 2002:a17:903:1104:b0:1c9:bca2:d653 with SMTP id n4-20020a170903110400b001c9bca2d653mr4934399plh.11.1698442607727; Fri, 27 Oct 2023 14:36:47 -0700 (PDT) Received: from localhost.localdomain ([2605:a601:a98f:6200:38e9:cf78:99f0:f758]) by smtp.gmail.com with ESMTPSA id i11-20020a170902c94b00b001c3a8b135ebsm1990293pla.282.2023.10.27.14.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 14:36:47 -0700 (PDT) From: Dave Johansen To: ffmpeg-devel@ffmpeg.org Date: Fri, 27 Oct 2023 15:36:44 -0600 Message-Id: <20231027213644.48259-1-davejohansen@gmail.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/hlsenc: Move lrint outside of loop 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: Dave Johansen 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: --- libavformat/hlsenc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 4ef84c05c1..e59a38b497 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1538,7 +1538,7 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs) { HLSContext *hls = s->priv_data; HLSSegment *en; - int target_duration = 0; + double target_duration = 0; int ret = 0; char temp_filename[MAX_URL_SIZE]; char temp_vtt_filename[MAX_URL_SIZE]; @@ -1589,12 +1589,12 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs) for (en = vs->segments; en; en = en->next) { if (target_duration <= en->duration) - target_duration = lrint(en->duration); + target_duration = en->duration; } vs->discontinuity_set = 0; ff_hls_write_playlist_header(byterange_mode ? hls->m3u8_out : vs->out, hls->version, hls->allowcache, - target_duration, sequence, hls->pl_type, hls->flags & HLS_I_FRAMES_ONLY); + lrint(target_duration), sequence, hls->pl_type, hls->flags & HLS_I_FRAMES_ONLY); if ((hls->flags & HLS_DISCONT_START) && sequence==hls->start_sequence && vs->discontinuity_set==0) { avio_printf(byterange_mode ? hls->m3u8_out : vs->out, "#EXT-X-DISCONTINUITY\n"); @@ -1643,7 +1643,7 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs) goto fail; } ff_hls_write_playlist_header(hls->sub_m3u8_out, hls->version, hls->allowcache, - target_duration, sequence, PLAYLIST_TYPE_NONE, 0); + lrint(target_duration), sequence, PLAYLIST_TYPE_NONE, 0); for (en = vs->segments; en; en = en->next) { ret = ff_hls_write_file_entry(hls->sub_m3u8_out, 0, byterange_mode, en->duration, 0, en->size, en->pos, -- 2.39.2 (Apple Git-143) _______________________________________________ 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".