From patchwork Fri Oct 27 00:11:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 5707 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp103392jah; Thu, 26 Oct 2017 17:11:29 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QJVR67LIpZHIupINJjnNgFR1wemGxNpCgapXiZ7TkYjs/YUvWjxu0SeC4OkNN84UigWij2 X-Received: by 10.28.181.2 with SMTP id e2mr350195wmf.81.1509063089385; Thu, 26 Oct 2017 17:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509063089; cv=none; d=google.com; s=arc-20160816; b=xiB374hAL8ROlZnFzCC7weEurCfjEulK9F58ZgZdFpM3n94OHCTKoiPdjJ6eVgrKbd To/54dr8e9DmGFERD3xnK0MqovPG+8kIdg2JUu6BGEzYkesCJfsY4qEk0h1O/kuHb/D2 N5OlBa1hND5PpXtq3W/jSmyloiT5O2ipTctmbisDSmyhbn4InZVGBNF5zMK7Sp1MtfuJ lsvvlGcrs+i8+tQ12oDQYS0dyIMykiZThrGbUASxq9ns7m1rn07M/YdZSAqMf+uTFdy6 oHDTiPfAP1VXCriIKwbkVvWYkHtPmRdOLFqVbMJzDdtxV1ywBLT657TVEehQv2LbZuKT an6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:message-id:date:to:from :delivered-to:arc-authentication-results; bh=3d/odMnyX0Cu+1AOSnOZw0gLGYIoiETqZY2nWpPg7mg=; b=cTgdwxkY4s+PeoGAQFXS6HKCS1ybiEj7DXznAdhAz5ejiMlHvLCNxB3DlVPB59gwGO 7hyHfDG6ITMdRQ/gIvXXUALZ7dkciapjdziPcUG+tL0NNYROKcH46lV5sBVbn8Krtqs/ W8cql6pn2R2WVy/tsKDQWYmDHmsUyie4VVI4p7e3nh833MGt8DdMyU/NPvK+Rl12FPSV IjXe+4cwUbDneNBkOCsxdUC5X2ThpYTd7cRuEmTxlzICf0R31NfBeG5vX/h2e7oecKQR AHhWnJ3igS9meRRzJKzDijVMRXUyFFW0YeyF4rGrX2FY7PgLuD/CWe9+38JXrKHAaZf+ qHaA== 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 z81si304348wmb.226.2017.10.26.17.11.28; Thu, 26 Oct 2017 17:11:29 -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 5394668A224; Fri, 27 Oct 2017 03:11:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgsg2.qq.com (smtpbgsg2.qq.com [54.254.200.128]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 27B4A68A20E for ; Fri, 27 Oct 2017 03:11:10 +0300 (EEST) X-QQ-mid: bizesmtp3t1509063071t25pz1wo0 Received: from localhost (unknown [223.104.3.172]) by esmtp4.qq.com (ESMTP) with id ; Fri, 27 Oct 2017 08:11:09 +0800 (CST) X-QQ-SSF: 01100000004000F0FI60B00A0000000 X-QQ-FEAT: IhrZBUlRAsjwcvpes1+gkl36LiJcOeBkwJtY29AQuB4qiEVguQDQWtXd2b+Mx YRLJygDGnkz2Y73FCSHQNNJfTelFK7GPJhPa+t1pcfrVlbnx6idbuHK0apb8zM1inxiR+2P YNnfk0nxgT7Opjf1lpR+R4SHxGlh9/CkmJqx2T6AK6brDX7Wjso8opiyrpuYzyfiTi7lot/ aAEmbn8geZa43b6GwaQsspranEVg147vwGpwdlYg9HUi0A37INNVjvKMKch8HWOwc2XiAnN HiyH5aYiDfkfDtbadl5KQZI+Y= X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Fri, 27 Oct 2017 08:11:09 +0800 Message-Id: <20171027001109.36857-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.11.0 (Apple Git-81) X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign1 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/hlsenc: fix missing first segment bug in fmp4 mode 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: Steven Liu MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" fix ticket id: #6776 fix code logic error, need not check first segment. Signed-off-by: Steven Liu --- libavformat/hlsenc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 55ce800c5a..530fc11305 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -1080,7 +1080,7 @@ static int hls_window(AVFormatContext *s, int last) avio_printf(out, ",BYTERANGE=\"%"PRId64"@%"PRId64"\"", en->size, en->pos); } avio_printf(out, "\n"); - } else { + } if (hls->flags & HLS_ROUND_DURATIONS) avio_printf(out, "#EXTINF:%ld,\n", lrint(en->duration)); else @@ -1088,7 +1088,7 @@ static int hls_window(AVFormatContext *s, int last) if (byterange_mode) avio_printf(out, "#EXT-X-BYTERANGE:%"PRId64"@%"PRId64"\n", en->size, en->pos); - } + if (hls->flags & HLS_PROGRAM_DATE_TIME) { time_t tt, wrongsecs; int milli; @@ -1113,11 +1113,9 @@ static int hls_window(AVFormatContext *s, int last) avio_printf(out, "#EXT-X-PROGRAM-DATE-TIME:%s.%03d%s\n", buf0, milli, buf1); prog_date_time += en->duration; } - if (!((hls->segment_type == SEGMENT_TYPE_FMP4) && (en == hls->segments))) { if (hls->baseurl) avio_printf(out, "%s", hls->baseurl); avio_printf(out, "%s\n", en->filename); - } } if (last && (hls->flags & HLS_OMIT_ENDLIST)==0)