From patchwork Tue Aug 30 09:30:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Liu X-Patchwork-Id: 330 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp2158361vsd; Tue, 30 Aug 2016 03:42:12 -0700 (PDT) X-Received: by 10.194.184.175 with SMTP id ev15mr2609623wjc.90.1472553732441; Tue, 30 Aug 2016 03:42:12 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d191si3885057wme.111.2016.08.30.03.42.10; Tue, 30 Aug 2016 03:42:12 -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; dkim=neutral (body hash did not verify) header.i=@gmail.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; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 670C6689BCE; Tue, 30 Aug 2016 13:42:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com [209.85.220.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9EDE768996C for ; Tue, 30 Aug 2016 12:30:15 +0300 (EEST) Received: by mail-qk0-f173.google.com with SMTP id v123so12398045qkh.2 for ; Tue, 30 Aug 2016 02:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=SdcfpFLBYox4zgOYiFQA1FumnCW0k3u7mzcuktMdbII=; b=hzILNAG7xHuCiIUPz8ME94bgl1/SHQT8WWK99g3vs5oz9iZFPeQJy3g86sRe9Xk5n3 LJjLULdl9yTTEnM3dxaVVkfZEBUwQZWKYXmTxaQmKkV9eh9PbZIJ1kP6ote0CBRcJp+f E1tPm0axxGn//LCk0BJJK0AUj9nfy/h1P3r1Eb038V0XH4ZKl2j2md0NoKemdTOrE0bi 5l93Q3mrQKSp4Clf4q9bVXTZDg91W9VDFxRyFpkWv7Y39W2vmNnWuQxbno+iTlJy5RQS AB1JDmQDIkd5oJJpWI84z1tPj5ZCVkucBnHXW83BDpcVj7lT/msPLMScKZeieDf3x9EX ifgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=SdcfpFLBYox4zgOYiFQA1FumnCW0k3u7mzcuktMdbII=; b=C0LNo5TtXfHHAVYjPPoqg2LwVbdHYWmxjHBC/T+xEd7sUL2e4vLcV0ts9v/4kXmJOO jGYKQCfQMbssrr4eU3FbDE/4js6eEq4IbF3QumSsrCFoF8OJOd2fWjnq+b64m7fOMtfV pPhPV0EQdu7r6hYveG6QW5XBxIWU9aGZhUipzYe+70yyrpUhAnLBFRJLTGEv2yDJ+4Y0 IY96DMgj7Fx0LejHVYsT1NMBmAeJuImUlYPmX0KCrjMIP1KFZuGkEMl9pbkE6jEqXTRG IktylM16RPKLu9p2bp7aABYZluO2lVCuMjijL/N04ZifOnk9MLK6Qka6v3uPbWX67AhN dXNw== X-Gm-Message-State: AE9vXwO6ziZnBl1kLoUo+TqnG5nsshhaJQE8JQPFVH/ex5IAVR5wJ5rc0TySvKUx4kjhyc6zuFw1w0qrT0L6kw== X-Received: by 10.55.140.131 with SMTP id o125mr2864623qkd.17.1472549419030; Tue, 30 Aug 2016 02:30:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.56.42 with HTTP; Tue, 30 Aug 2016 02:30:18 -0700 (PDT) From: Steven Liu Date: Tue, 30 Aug 2016 17:30:18 +0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] [PATCH] avformat/hlsenc: add warning for append_list and hls_init_time option 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" When use append_list mode, the hls_init_time set nouse, Because the append_list only support append at the old m3u8 end cannot set init segments durations at the middle of the list. That's invalid use append_list and hls_init_time one time. and show a warning message for user. Signed-off-by: LiuQi --- libavformat/hlsenc.c | 6 ++++++ 1 file changed, 6 insertions(+) if ((ret = hls_start(s)) < 0) -- 2.7.4 (Apple Git-66) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index ab4a9bf..b08f7ec 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -812,6 +812,12 @@ static int hls_write_header(AVFormatContext *s) if (hls->flags & HLS_APPEND_LIST) { parse_playlist(s, s->filename); + if (hls->init_time > 0) { + av_log(s, AV_LOG_WARNING, "append_list mode cannot set hls_init_time," + "this is append to the endlist of the old m3u8\n"); + hls->init_time = 0; + hls->recording_time = hls->time * AV_TIME_BASE; + } }