From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id D558045B5D for ; Fri, 24 Mar 2023 11:41:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5D9BF68C755; Fri, 24 Mar 2023 13:41:29 +0200 (EET) Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 56A8A68C17F for ; Fri, 24 Mar 2023 13:41:22 +0200 (EET) Received: by mail-oi1-f169.google.com with SMTP id s8so1063457ois.2 for ; Fri, 24 Mar 2023 04:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679658080; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1Hpuiae6nsikpk255DF4Vt7hDorOSnPiIWyiqoOm/F8=; b=TUrPHh7qN03B6L1rQyu3zQAImwc0Vh9o6sigLk/0Hj29ms596UPiRGZ+Aqx5hh6tPi 0cU9PCJXDZHIA6pKf8Sj+jWtDSyLZZyVlLiWDaY+tRbj0VAlZBp6bKBG9081GeVzSufJ HhPUKgeRtQ6h0+axCNLFy0945J02GO7RCzgQqjqwB70lGUB7mb1/FsP5J2rNt+KF8Bcn z2uHzihB+2xSG1aKsf9zxwcf5tMYA2X1GsRMIZl1+Wu7gHGGReY4vp+OH0WVrbXmojYq vGaSvxMFv9t+GdzBKTwytntU5Fud7Hs9hhnwluVK+/o+teDgU5qRSPQLqXtQWvFOqqa/ SgLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679658080; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1Hpuiae6nsikpk255DF4Vt7hDorOSnPiIWyiqoOm/F8=; b=L+UqYAFB8XWUjnItq+L2RhijLBxsMMZ5QTAJoeTisbCadDGNyFA4rpApzvCXZMzwmF Jz//ZOZivbDQ1b3JcJJZmEMLpsSNMPViF0BkTK6fCUJev2cNLsCITDBCg69mEj6C1Ane prKKkfw9R7PwOgXoQ7eXz4ANuxsW8spcJF6jgu0IyUoaIKkHjouuwmsN8Y765LLQBq/w KUhPEJSstNkYYEkAE6kxeWBu1xV8rTc3W7C+JlwKhuFgzugGWVUwsBrljVwr1211kMkF BOR0nW8QvF84Y6Bl5JmLm8vuP5HW2FXKQ1neLrmCjMD7x3COL7hNb8jK/jV2+2bwVDlX BNRg== X-Gm-Message-State: AO0yUKUO0AoqLeER//ie/Bdvn7NI7HjU7J2skT9qgMpnybkwtwJxXmqZ VStCDpqtnn390PRHBPBoxMSnJc8CIYI= X-Google-Smtp-Source: AK7set/AjY2OtS3BwQV1PFIFsUGajJNF4K7psNWmjh/fBXbROl2PDXPvt6D+34UU5XghH7RHEsfxIg== X-Received: by 2002:a05:6808:5cb:b0:386:dfaf:588 with SMTP id d11-20020a05680805cb00b00386dfaf0588mr927341oij.40.1679658080596; Fri, 24 Mar 2023 04:41:20 -0700 (PDT) Received: from [192.168.0.14] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id l20-20020a544114000000b0038413a012dasm3571138oic.4.2023.03.24.04.41.19 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Mar 2023 04:41:20 -0700 (PDT) Message-ID: <5ad3a06f-e5c7-13d0-3783-e0e03d655a15@gmail.com> Date: Fri, 24 Mar 2023 08:41:27 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20230321170637.10907-1-jamrial@gmail.com> <20230321170637.10907-5-jamrial@gmail.com> <167965785107.27013.200047096152168442@lain.khirnov.net> From: James Almer In-Reply-To: <167965785107.27013.200047096152168442@lain.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 5/7] avformat/matroskaenc: write a MaxBlockAdditionID element X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 3/24/2023 8:37 AM, Anton Khirnov wrote: > Quoting James Almer (2023-03-21 18:06:35) >> A non zero value is mandatory for Matroska if the track has blocks with BlockAdditions. >> >> Signed-off-by: James Almer >> --- >> libavformat/matroskaenc.c | 36 ++++++++++++++++++++++++++++++++---- >> 1 file changed, 32 insertions(+), 4 deletions(-) >> >> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c >> index 46f4331a18..0687d9c32e 100644 >> --- a/libavformat/matroskaenc.c >> +++ b/libavformat/matroskaenc.c >> @@ -188,6 +188,8 @@ typedef struct mkv_track { >> int64_t last_timestamp; >> int64_t duration; >> int64_t duration_offset; >> + uint64_t max_blockaddid; >> + int64_t blockadditionmapping_offset; >> int codecpriv_offset; >> unsigned codecpriv_size; ///< size reserved for CodecPrivate excluding header+length field >> int64_t ts_offset; >> @@ -1597,12 +1599,21 @@ static int mkv_write_stereo_mode(AVFormatContext *s, EbmlWriter *writer, >> return 0; >> } >> >> -static void mkv_write_dovi(AVFormatContext *s, AVIOContext *pb, AVStream *st) >> +static void mkv_write_blockadditionmapping(AVFormatContext *s, MatroskaMuxContext *mkv, >> + AVIOContext *pb, mkv_track *track, AVStream *st) >> { >> #if CONFIG_MATROSKA_MUXER >> AVDOVIDecoderConfigurationRecord *dovi = (AVDOVIDecoderConfigurationRecord *) >> av_stream_get_side_data(st, AV_PKT_DATA_DOVI_CONF, NULL); >> >> + if (IS_SEEKABLE(s->pb, mkv)) { >> + track->blockadditionmapping_offset = avio_tell(pb); >> + // We can't know at this point if there will be a block with BlockAdditions, so >> + // we either write the default value here, or a void element. Either of them will >> + // be overwritten when finishing the track. > > IIRC matroska uints are variable-size, so the value you write later may > have a longer representation than the dummy placeholder you're writing > here. > Or am I wrong? It might if we were to write any arbitrary value passed to the muxer in AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL side data, but we will not. We're only going to write 1 (opaque, codec specific, currently used for alpha channel) at this point in the patchset, or 4 (itu-t t35) after patch 6/7, for now. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".