From patchwork Thu Dec 21 15:41:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jeyapal, Karthick" X-Patchwork-Id: 6892 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.79.195 with SMTP id r64csp1077345jad; Thu, 21 Dec 2017 07:41:51 -0800 (PST) X-Google-Smtp-Source: ACJfBouFqMvCz7srtS5WL09wt4I4vcU6t92ogSGMUxZ+PCW6dLNqrWQRP6rGGlkqhX5ljQm4YaAg X-Received: by 10.223.150.61 with SMTP id b58mr11751216wra.185.1513870911315; Thu, 21 Dec 2017 07:41:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513870911; cv=none; d=google.com; s=arc-20160816; b=jz6djZMmt+Ocyax8OJcfpbWX/MJjy82vxADkByaX0gs+KvRSSV7vIINyzlwVeXICxa V0ptE2r1mw6xoQZoWyR15jcKeQ5b5Di2Du2aW34KuiV2joL5bjLrU5gf18AkoX1L9c9z EZzP1YwOYOcOilk9j+pYxMt8b/SkioWQDPIziON4U0lN1n9DDvaPCyD4cWT6hbfVJxsz g54jbxe65KcgRN+wnbgastVUQiQjVyoqYJrKowsiZWuBi48Cq2x9zW0c2R1NrMoO1MB7 jq0j2lw0fMAp6AxbXl7mtG/ko31J/Qw4g1W+9+ow1bDfk7B1V6O/8wbX4gESwvPS4wPK 867g== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=UwE2yIauGGXFc5cge4K+9izNemnOEqmpDrEIgOPdSJA=; b=rJRqztWWqylhxLm0g52WL9ZeDCF+E+A4PVkuWBsdyR0cfa7mmNA+ebXa3wqjNh3UQ0 9vSDo56yUJONBZCta2KoYjmLNf6IZbUuC69JqifVi3RwhTARxT8KTHvcIKcMMx6vneNO pqTTUtawaWrI6aIFrTGNt9ZU733WurTsHAAYFnc3+hhpXxHcLMnuL39AG+/NcPkDw4tP jp+LcMEWP/E5DRe5ZcwfBRGMeBxKSU2NFrrmP6EjDALy5VymeKxtxCqmeFlAlBCRpZn8 Ga9DPAB/oDus8yiOPzLpfNrjYeMz9gjnACfmCK6XtmBUPPJGJ1J0JB294lT6O1bDvgGS sxDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=JCendf4p; 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=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d2si15612318wrf.65.2017.12.21.07.41.50; Thu, 21 Dec 2017 07:41:51 -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; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=JCendf4p; 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=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1242F688330; Thu, 21 Dec 2017 17:41:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a2i831.smtp2go.com (a2i831.smtp2go.com [103.47.207.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 10E8B6882BA for ; Thu, 21 Dec 2017 17:41:21 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m78bu0.a1-4.dyn; x=1513871797; h=Feedback-ID: X-Smtpcorp-Track:Message-Id:Date:Subject:To:From:Reply-To:Sender: List-Unsubscribe; bh=PEjc6KbLxWnymDKmXEzx+Ow09lvYmMXFh5U+rwYqz18=; b=JCendf4p OBlcP8jf+m9GK3SlNuCnMaeLszEJwY8wIAc4R1ZjA7OF/TX9k++gBj1OmOWvXThcWzjxIBXlmNdOw uA+XuAvvXL59aY354TtsWbNyAiGjWly619PPceegcGzdBFGy8tUXwxDV+1lOAD0CdXm2otCQ/Tc5Q WWAPv0TA6/qM6P7X1Fd0ukSYycwOA/2hRLL25fihbcf0x1zRvFDEB7uSADwenqomE4cABHe5eurVM 0OsNS1qLLBpyD0DYWk5Chj0II4ePYZ7J0Kd0lscvy+F1yX1XOFGD36tkdnmwvdJWVKW9O1O5LMpG2 NylMnkLRdLquvEMT/ls1f15Ajg==; From: Karthick J To: ffmpeg-devel@ffmpeg.org Date: Thu, 21 Dec 2017 21:11:11 +0530 Message-Id: <1513870872-21179-1-git-send-email-kjeyapal@akamai.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-Smtpcorp-Track: 1-S2yNRyIuhb1S.O5YXb9Fh6 Feedback-ID: 337386m:337386asVRLGB:337386scJBP1H87V:SMTPCORP X-Report-Abuse: Please forward a copy of this message, including all headers, to Subject: [FFmpeg-devel] [PATCH 1/2] avformat/dashenc: Fix the EXT-X-TARGETDURATION as per the hls specification 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: Karthick Jeyapal MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Karthick Jeyapal The HLS specification states the following about EXT-X-TARGETDURATION 4.3.3.1. EXT-X-TARGETDURATION The EXT-X-TARGETDURATION tag specifies the maximum Media Segment duration. The EXTINF duration of each Media Segment in the Playlist file, when rounded to the nearest integer, MUST be less than or equal to the target duration; longer segments can trigger playback stalls or other errors. It applies to the entire Playlist file. Its format is: #EXT-X-TARGETDURATION: where s is a decimal-integer indicating the target duration in seconds. The EXT-X-TARGETDURATION tag is REQUIRED. Currently the dashenc rounds the duration to the next integer, rather than rounding the duration to the nearest integer. --- libavformat/dashenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 5687530..5368a23 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -358,7 +358,7 @@ static void output_segment_list(OutputStream *os, AVIOContext *out, DASHContext Segment *seg = os->segments[i]; double duration = (double) seg->duration / timescale; if (target_duration <= duration) - target_duration = hls_get_int_from_double(duration); + target_duration = lrint(duration); } ff_hls_write_playlist_header(out_hls, 6, -1, target_duration,