From patchwork Tue Apr 28 08:36:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 19310 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id BA54E44A1EE for ; Tue, 28 Apr 2020 12:30:31 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 93E0F68BDE1; Tue, 28 Apr 2020 12:30:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0EA2A68BDDE for ; Tue, 28 Apr 2020 12:30:25 +0300 (EEST) Received: by mail-ej1-f68.google.com with SMTP id rh22so16688247ejb.12 for ; Tue, 28 Apr 2020 02:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=22OXbt8DrB/Eq816XLMFZYhm9RLizcASD1FqmatfSgk=; b=bKPBpXNJTrTV+cJChQpHjRF+66z1W+YCsrVg6zjSVzngM6iE1KIoYOkvsO2+QIhO84 bzv0si6MaC3JbsrOiIErcEUqE2Z1+SMqe/QlbrpQ747tz3sRaDfyNbPZkZuHnvX7lhhA JF7uPWInYqKTPnLgrfbFyD1mIdwxtJCtbbhQrogWwaLE5c1iK6SjepuK5uzwaiHPQiU/ 1Qt8mWxFQLsHB6k73202YQjvvlHaTTLhAbF6zYqRjH+Ix44WR98/lS4MHgUlJbcFirEY Bwbx5IoI4exEABBK977hilNwB5M7wshaPpzInajESuQqqV2acgoVGps+No9iS4aCLwFo t2VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=22OXbt8DrB/Eq816XLMFZYhm9RLizcASD1FqmatfSgk=; b=eqTCymTHBSvjiqw1MQfhMk44lNZM8tfjMS1IkCVWGmGG4dxazOfwhSE9uLQpL5jAzV vYWAsf0PRn5qfCtPB5yp3nWsbdgJitwX6PWhsC54tN9tE+a2q+fREVD7Aaeoi/unHI0l ygtoWVoau7b/x3a22ZITWnJqywMRxelWvcOyWcNdinGPl4riVy/QFvetp8fHDV659Ocu SzgTf2owzUjhYGuFPxoM5qAmbbzfgTyfKpHkODib1vE40YyIgYA+symrDvlzXXLczUv6 0NIi115dRLdo7/Qhx8Ba2zVmJPaEBFUzYpCxRCePGcHQL/xF+/GswFpfKXBizO6gHdX+ gm4w== X-Gm-Message-State: AGi0PuZL9neL0QVJO2IfkuwhnrZVdcWhjnNMno3EvP6zdhUA4XBRRl98 kr0i+N+OW5quIpvLftSvzR6qh7pO X-Google-Smtp-Source: APiQypIlG80b0JuuMqQQT6FzZpGS15bWkDb8Y2VV6ny5tdzrrJg50PrURw+GOTZTnq8oB64RQsn+Ug== X-Received: by 2002:adf:83c2:: with SMTP id 60mr31545229wre.169.1588063014449; Tue, 28 Apr 2020 01:36:54 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id w11sm2258351wmi.32.2020.04.28.01.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 01:36:53 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 28 Apr 2020 10:36:39 +0200 Message-Id: <20200428083645.4909-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/7] avformat/matroskaenc: Write SeekHead when livestreaming 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Commit 6fd300ac6c2c3871736ce0e6df95603255004dc6 added support for WebM Chunk livestreaming; in this case, both the header as well as each Cluster is written to a file of its own, so that even if the AVIOContext seems seekable, the muxer has to behave as if it were not. Yet one of the added checks makes no sense: It ensures that no SeekHead is written preliminarily (and hence no SeekHead is written at all) if the option for livestreaming is set, although one should write the SeekHead in this case when writing the Header. E.g. the WebM-DASH specification [1] never forbids writing a SeekHead and in some instances (that don't apply here) even requires it (if Cues are written after the Clusters). [1]: https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification Signed-off-by: Andreas Rheinhardt --- libavformat/matroskaenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 784973a951..dd77ae64bc 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1896,7 +1896,7 @@ static int mkv_write_header(AVFormatContext *s) if (ret < 0) return ret; - if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL) && !mkv->is_live) { + if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL) || mkv->is_live) { ret = mkv_write_seekhead(pb, mkv, 0, avio_tell(pb)); if (ret < 0) return ret;