From patchwork Thu Jan 26 02:24:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 2323 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp2492227vsb; Wed, 25 Jan 2017 18:24:24 -0800 (PST) X-Received: by 10.28.11.10 with SMTP id 10mr518510wml.109.1485397464647; Wed, 25 Jan 2017 18:24:24 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p5si101916wrd.242.2017.01.25.18.24.21; Wed, 25 Jan 2017 18:24:24 -0800 (PST) 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 CB09C68A769; Thu, 26 Jan 2017 04:24:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B58FA68A3A1 for ; Thu, 26 Jan 2017 04:24:12 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id DDCDE102E6A; Thu, 26 Jan 2017 03:24:12 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h79DvQItSmDv; Thu, 26 Jan 2017 03:24:11 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 980F9100C5A; Thu, 26 Jan 2017 03:24:11 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 26 Jan 2017 03:24:08 +0100 Message-Id: <20170126022408.13987-1-cus@passwd.hu> X-Mailer: git-send-email 2.10.2 Subject: [FFmpeg-devel] [PATCH] avformat/segment: remove last_cut check when detecting a new segment X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: deti@fliegl.de, Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Not starting a new segment if the elapsed microsecs since the start of the day equals the the elapsed microsecs since the start of the day at the time of the last cut seems plain wrong to me, Deti do you remember the original reason behind this check? Signed-off-by: Marton Balint --- libavformat/segment.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavformat/segment.c b/libavformat/segment.c index 9d47148..8ec3653 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -87,7 +87,6 @@ typedef struct SegmentContext { int64_t clocktime_offset; //< clock offset for cutting the segments at regular clock time int64_t clocktime_wrap_duration; //< wrapping duration considered for starting a new segment int64_t last_val; ///< remember last time for wrap around detection - int64_t last_cut; ///< remember last cut int cut_pending; int header_written; ///< whether we've already called avformat_write_header @@ -870,10 +869,8 @@ calc_times: localtime_r(&sec, &ti); usecs = (int64_t)(ti.tm_hour * 3600 + ti.tm_min * 60 + ti.tm_sec) * 1000000 + (avgt % 1000000); wrapped_val = (usecs + seg->clocktime_offset) % seg->time; - if (seg->last_cut != usecs && wrapped_val < seg->last_val && wrapped_val < seg->clocktime_wrap_duration) { + if (wrapped_val < seg->last_val && wrapped_val < seg->clocktime_wrap_duration) seg->cut_pending = 1; - seg->last_cut = usecs; - } seg->last_val = wrapped_val; } else { end_pts = seg->time * (seg->segment_count + 1);