From patchwork Sun May 8 00:54:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Liu X-Patchwork-Id: 35683 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a885:b0:7f:4be2:bd17 with SMTP id ca5csp2358868pzb; Sat, 7 May 2022 17:55:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO7866+cPZ+SL6vjjuwwbGGp6gvLEcZ0CRf/k5OWv51lILWP0ReHLYr3daO0GNj0hc0zHa X-Received: by 2002:a50:bb0e:0:b0:425:c727:566e with SMTP id y14-20020a50bb0e000000b00425c727566emr10501105ede.132.1651971332753; Sat, 07 May 2022 17:55:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651971332; cv=none; d=google.com; s=arc-20160816; b=xZrWCHShBzxWdSjL6Ltqfgbai5Pva8m2JmGUYPasohLw8mOxiDqCClh79WD5FhPARs s704ytPuoGpEvrbvZIqI0aW/pc+dJD01eSD+hHUNngiXRPhyZBFF/G5XEFv5KN82pSnq ptcXtYJNLMZIPdpUEFXIZlUeknitJ82jsyZjWgcqU7AMQfO1f2q+vYGiGPSO9G0l4fhm MI2eQXHUYEtDIrDMLl/P8u7UySloG5D7yBt5CaGZFGq01jzRIw3NXTkQf46P4nj9u0s2 US60G7HPT7HewuUd+nREljMGoNiTU2am42URHDabw3NZjdgxkh3TIhA3cRHeDPLD/wHM obkw== 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:feedback-id:mime-version:message-id:date :to:from:delivered-to; bh=DHqtP++0RfDkDQfVK/AxKeaDqGn7XAdu0vSgzzjK5wA=; b=rCOEdHKVJqLC56K9/dgKb3kpDHC3Jr++BfEElzQdXjXZP4StsUR3vCR4DmG/EjU7xq v2sVU6oG9JqRbhBLqZF68OZvCvvIpxSYqS1W8ALLcRwSDNHjgwOGkLN8Q2C5REmYSvGh rCe6aoYtS7k6rgUSZtIABUG3Xd4yR1KZfjgCpWm6lIkpFD101KZHO2UEFkLmajgNn+2/ jY+P2lGg5Bo5KmvQc/SW8bPGVH5AT94yvs7NJcytNGunSUQ/vySRf7b/0mIDl63s0xi/ QptNa7/n7YNm1FNZN9uy8dFggZMCvKMfb3iOTJ5/iq+BfGhb6PM/mLKm14AiBnmvFgY3 phyQ== ARC-Authentication-Results: i=1; mx.google.com; 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 dz11-20020a0564021d4b00b00418c2b5bf3dsi10090545edb.543.2022.05.07.17.55.32; Sat, 07 May 2022 17:55:32 -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; 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 674D168B370; Sun, 8 May 2022 03:55:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbg.qq.com (smtpbg139.qq.com [175.27.65.136]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 43FE368B0F2 for ; Sun, 8 May 2022 03:55:19 +0300 (EEST) X-QQ-mid: bizesmtp89t1651971314tu62bixv Received: from localhost ( [114.245.19.167]) by bizesmtp.qq.com (ESMTP) with id ; Sun, 08 May 2022 08:55:13 +0800 (CST) X-QQ-SSF: 01100000002000Z0Z000000A0000000 X-QQ-FEAT: dpyQmELDBxF8mFTSkHffqQRdLSN7Hle1VZPHfOM0hGe48ucC7U3det/xMawze CSbwb4wNLTXeArRniq0dpI/vcbLjdYRlpZP47rIRgsdyZBKq0+W1Z1o1GLS9wYSgggb+aDO m9jK+V6wXY5SHwsoTobvwCLT/z/VepCdGhfIWpBlqGvW83StCfAsUPF2yhryzUCvOWe651T Cv+y+jrvizok0xA6MqA3JD06ZjRzZMTWJ9xtS6OPcngOddE8FPCOSH/vY8hHlheyaSescUC N01G8jI5OguFbet2g4ws/WvR+BcypHXE1ODW1AxmJu/ayDZ48rscOsGPi34JOyZwnpSf0BY ocQSzho X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Sun, 8 May 2022 08:54:17 +0800 Message-Id: <20220508005418.1270-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgspam:qybgspam6 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/hlsenc: check option before set discont_program_date_time 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dyMUGfeG+C7r fix ticket: 9238 There should check option flags with HLS_PROGRAM_DATE_TIME before set discont_program_date_time. Signed-off-by: Steven Liu --- libavformat/hlsenc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index d2b8215dff..d91c7ebcb7 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1288,8 +1288,10 @@ static int parse_playlist(AVFormatContext *s, const char *url, VariantStream *vs new_start_pos = avio_tell(vs->avf->pb); vs->size = new_start_pos - vs->start_pos; ret = hls_append_segment(s, hls, vs, vs->duration, vs->start_pos, vs->size); - vs->last_segment->discont_program_date_time = discont_program_date_time; - discont_program_date_time += vs->duration; + if (hls->flags & HLS_PROGRAM_DATE_TIME) { + vs->last_segment->discont_program_date_time = discont_program_date_time; + discont_program_date_time += vs->duration; + } if (ret < 0) goto fail; vs->start_pos = new_start_pos;