From patchwork Tue Aug 21 12:33:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Jendrzej X-Patchwork-Id: 10048 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp4252jap; Tue, 21 Aug 2018 12:56:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYua8TdCLMXiwNw5sDrn7cj5Xbwl8u2w4nQEzRIqzqHizXeWbzEpzUXizkF5A44ZosA1+96 X-Received: by 2002:a1c:c3c6:: with SMTP id t189-v6mr476435wmf.59.1534881371002; Tue, 21 Aug 2018 12:56:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534881370; cv=none; d=google.com; s=arc-20160816; b=EfuP6YbJ4P4ZqKAp9fqQwRc0x+/dkBCmLy9KwzJaRy8YE1Ohkny3JRcCHx5ARHrFWL 83NYad/r7Oo/t9c3SIcdyCadaeSL4Jz9o+EL+hmwkVzGfTIciEKhz9W8fR1t8potUsmM b2yWv+pTIeS5q69Md3KJ7oljnhlxDLGGtGRhuU8xQjOege2tYzTw9rEel+DImYiq/6Y4 q63RW4rxIf/mIuVHsb+nlCk1c32o+MEX0tSLDU0cclqgNHVTBL+FlrR5F/b2La9eqgYo Cry90OYDsQqG0t22i22yVK1XxrnZal50EPJGdXfWAvtVvzzz3mCeb36+Zo1qxx2Mf62X iRxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to :arc-authentication-results; bh=+V+C2hvpuMXfm/2Bm6C27usMyEP33mO7HqUME1TyWAo=; b=fSBLXY63YKRETLimt8918ztT/2bA18sVP3XbT7fCooYsXmcKkf527MXBpaTpig+oov zArHqCyypUD/DBVIirIKR1AmtOC0VD8bjrVsCOj5lVrbBDTaQT2hljh5b4LMlLoLj5ir sVboMoc3Gyvl0kd9jljI3HdQfRbHrxxQi9tmJNBiRzsPYjG+6Ok1fABDEeBGQHKLo8L+ RzXYKjx/5PqDujCLBYosItbkC3RBecXrjBnwzOCrL/ZsJySTrSAasnTVv0DovyL1SAmz VjVD4DyvLlv9Hajpga992sJKsxcu+wA9sKEEsKkf0T4CtEGydJ+AS3s0qSDPkIG3XlBr U0QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=RAOO3s9J; 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 sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l20-v6si3108263wma.101.2018.08.21.12.56.10; Tue, 21 Aug 2018 12:56:10 -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 header.s=20161025 header.b=RAOO3s9J; 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 sp=QUARANTINE 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 8CE37689AB5; Tue, 21 Aug 2018 22:56:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 59F00689744 for ; Tue, 21 Aug 2018 15:39:04 +0300 (EEST) Received: by mail-io0-f171.google.com with SMTP id n18-v6so15237215ioa.9 for ; Tue, 21 Aug 2018 05:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=bOwO2v/LFvCAMq9ckr416KBUe292ooWfkdSBo8GukM8=; b=RAOO3s9J6WWtxg6xvpDUsosSQ0gutQL/UQ7xLa8ykIJNcXHDheZ/QsDNMkLzNHnW9e zEs4OtLk3e3pxaKJ4h6FKW3EE6jrZNR4VnDReh1MAHi40/aGu6YOzm+vXNIxWwtcnxny EHa36qs+FhbxAwM3+YAPIVGEB32Y5DQ+0M4x8BBgt/UhX92LilY+DC31+7v0t1/yy0ja 6u3gY8me4E0mos0YmxVH17mS55O+ZSgMvyT0lzy0E2sX5Zv7EFaGPO+dkR3qvqShGIr8 5VaaiiT5QmcQHosW7GBQKohHYXJvag2iNUD3bCbPXekgQVLDJ4Py3l0Zd/MT/p6A89HT vbnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=bOwO2v/LFvCAMq9ckr416KBUe292ooWfkdSBo8GukM8=; b=UvPAO4hVOLmwouKgLGfE0Y4MhnZB373n35u9/5crrGM26ltvpsHk1Aat0FhIB+cGXY yYpIw4lhXaPN0Dp/lq/+z4wSpcCx05zGAZ7j9df4+Ri9iVxB46nNK0AqGlsNllxEnwaM TZcQtMpJ9T62knLTqhqtpadNfUKWNrTXpLjssVqlr3FgBkTBJYvQcCe5F6Wg0lrpkfQV /T2XHfulybPAAL5Va/zsKEIAc1NnTFso99uqnSd6P4aoYAuuLNNAGrLj59586M/8cJce wkmpexg09mOmLXr9qr0MJTMc+VKTKiOGsdjF2jQKifGKbEdk8iNYi+iq4eTBiCnDO9kN eDTA== X-Gm-Message-State: APzg51D9p+kjYlanKKF47Ikxm8Wwz90PvdRrbmR/kDzRnR1qD8LfsCDn K8R/8YKb3U1nJYUm12iClrPw325/Kl3qGOO09jSZmOHH X-Received: by 2002:a6b:6612:: with SMTP id a18-v6mr6672630ioc.160.1534854801440; Tue, 21 Aug 2018 05:33:21 -0700 (PDT) MIME-Version: 1.0 From: jacek jendrzej Date: Tue, 21 Aug 2018 14:33:09 +0200 Message-ID: To: ffmpeg-devel@ffmpeg.org X-Mailman-Approved-At: Tue, 21 Aug 2018 22:56:07 +0300 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] avformat/dashdec: Fix calc_cur_seg_no if availability_start_time not 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" Hi. Here is an example: http://vm2.dashif.org/livesim-dev/testpic_2s/Manifest.mpd ffplay http://vm2.dashif.org/livesim-dev/testpic_2s/Manifest.mpd ffplay version N-91650-g6972dae5a4 Copyright (c) 2003-2018 the FFmpeg developers built with gcc 8.2.0 (Gentoo 8.2.0-r2 p1.2) configuration: --prefix=/mnt/BIG/ffmpeg/root/ --disable-doc --disable-stripping --enable-debug=1 --enable-libxml2 --enable-demuxer=dash --enable-openssl libavutil 56. 19.100 / 56. 19.100 libavcodec 58. 24.100 / 58. 24.100 libavformat 58. 17.103 / 58. 17.103 libavdevice 58. 4.101 / 58. 4.101 libavfilter 7. 26.100 / 7. 26.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100 [dash @ 0x7ffa8c000b80] Could not read complete fragment.0B f=0/0 [dash @ 0x7ffa8c000b80] Could not read complete fragment.0B f=0/0 Input #0, dash, from ' http://vm2.dashif.org/livesim-dev/testpic_2s/Manifest.mpd': Duration: N/A, start: 1534854670.016000, bitrate: N/A Program 0 Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 30 fps, 30 tbr, 90k tbn, 60 tbc Metadata: variant_bitrate : 300000 id : V300 Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp Metadata: variant_bitrate : 48000 id : A48 [http @ 0x7ffa8c073fc0] HTTP error 404 Not Found 10KB sq= 0B f=0/0 [dash @ 0x7ffa8c000b80] Failed to open fragment of playlist 0 [http @ 0x7ffa8c074780] HTTP error 404 Not Found 6KB sq= 0B f=0/0 [dash @ 0x7ffa8c000b80] Failed to open fragment of playlist 0 [http @ 0x7ffa8c236200] HTTP error 404 Not Found 0KB sq= 0B f=0/0 [dash @ 0x7ffa8c000b80] Failed to open fragment of playlist 0 [http @ 0x7ffa8c32d940] HTTP error 404 Not Found 0KB sq= 0B f=0/0 [dash @ 0x7ffa8c000b80] Failed to open fragment of playlist 0 [http @ 0x7ffa8c086000] HTTP error 404 Not Found 0KB sq= 0B f=0/0 [dash @ 0x7ffa8c000b80] Failed to open fragment of playlist 0 [http @ 0x7ffa8c2312c0] HTTP error 404 Not Found 0KB sq= 0B f=0/0 [dash @ 0x7ffa8c000b80] Failed to open fragment of playlist 0 [http @ 0x7ffa8c2312c0] HTTP error 404 Not Found 0KB sq= 0B f=0/0 [dash @ 0x7ffa8c000b80] Failed to open fragment of playlist 0 [http @ 0x7ffa8c2312c0] HTTP error 404 Not Found 0KB sq= 0B f=0/0 From 08980973a58afbf441e624f2dcd6b7efb537c97e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 21 Aug 2018 14:15:42 +0200 Subject: [PATCH] lavf/dashdec: Fix calc_cur_seg_no if availability_start_time not present --- libavformat/dashdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index c6dddeb98f..85fbe6aacc 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -1296,7 +1296,7 @@ static int64_t calc_cur_seg_no(AVFormatContext *s, struct representation *pls) if (pls->presentation_timeoffset) { num = pls->presentation_timeoffset * pls->fragment_timescale / pls->fragment_duration; } else if (c->publish_time > 0 && !c->availability_start_time) { - num = pls->first_seq_no + (((c->publish_time - c->availability_start_time) - c->suggested_presentation_delay) * pls->fragment_timescale) / pls->fragment_duration; + num = pls->first_seq_no + (((c->publish_time - c->time_shift_buffer_depth + pls->fragment_duration) - c->suggested_presentation_delay) * pls->fragment_timescale) / pls->fragment_duration; } else { num = pls->first_seq_no + (((get_current_time_in_sec() - c->availability_start_time) - c->suggested_presentation_delay) * pls->fragment_timescale) / pls->fragment_duration; } -- 2.18.0