From patchwork Fri May 22 01:24:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 19801 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 8FFB944BA89 for ; Fri, 22 May 2020 04:25:10 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 738B368AD8A; Fri, 22 May 2020 04:25:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E5E0768ACA6 for ; Fri, 22 May 2020 04:25:02 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id f5so62961wmh.2 for ; Thu, 21 May 2020 18:25:02 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=CTL1op9AAoUbnSSkyN3eVA+H3UNiKdx43YRxqTbzmEM=; b=iJ0FEwRbHiUuWh3Ghsr1qlB/DB4XWeS5OJPCuYGTrZEEGYENCWWTs3u2HCVLH6teC4 2bI0rtfKBmuQlJ8l3Amnky+VB+v5xMx/XVNr9Ndrb/33MajRrlw0yXOo5w7eT7d5XCce o8SKhMDv4Y+JaNjX1UwaUbi2Ld7rIeaE8VNL+Cuejk2+8tgXCiljpMMo1RUyARCjH/Bt OQW5tiKafVbyx1RYi3Vv6NVuoOoCax/LLNJ4/ct6yLZsAUndCpzLwc5pknPnvEZ9NiF8 1XYG4HbocOQvmFarYIUo0tLTI/0Ta6PU7ai6YmVTjHMnUYuFQ1NWf8UwCim/3poMOSHw G05A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=CTL1op9AAoUbnSSkyN3eVA+H3UNiKdx43YRxqTbzmEM=; b=A0ZHmVzIKitOcVdHxpcTxO4FT/2L9Lnpw7UweDiINUfhC30wKdj39GS3/otJ0IsGBX Jpuo3Uyw1W6af9dr2l451CIPN+7iTZ2qtMLytqHJ7b6mP1KAWlHyeks4XLSgKpo4b7JY Bu5GyNRywwevRAcWvjbecXVxQAmq6TGo0WPRBnnJYINI1i9Z9BNcKkTP4P9iztMfBsIg AKnMPNeEoUoBfiKyuEGg1KYKOcfKYloKijklCCYK46xVGiwuK6wjeNJnfmmM2nKwR0H5 fyvs9+imRO9C9GziYzE7eR59wCbQ0aNajnWwABMJ/5sZQZS1F3NiijwI2p8ZjwO6PszY EEPQ== X-Gm-Message-State: AOAM530geiZysJ5WbT4tBSSaUoJSytgsqZQRQ3sfBl/mUmd9hTv/GrEl EGsGzlCH/km45b8/0judyRD40MUS X-Google-Smtp-Source: ABdhPJz7UgHj+n8hyx+VBMcnMD/fF+y4WSCWKQC0SYfx8CF1J6kZZhkc2K1BtHNBsmP6eGv+a9TzWw== X-Received: by 2002:a7b:cf22:: with SMTP id m2mr11779298wmg.82.1590110702061; Thu, 21 May 2020 18:25:02 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id l19sm8548498wmj.14.2020.05.21.18.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 18:25:01 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 22 May 2020 03:24:31 +0200 Message-Id: <20200522012431.29918-3-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200522012431.29918-1-andreas.rheinhardt@gmail.com> References: <20200522012431.29918-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avformat/utils: Set stream side-data size even without side-data 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" Signed-off-by: Andreas Rheinhardt --- Was the earlier behaviour actually a bug (I think so) or is this new behaviour something that should be explicitly documented? Btw, the stream and packet side-data APIs differ in two more ways: av_packet_new_side_data() adds padding to the buffer and zeroes it whereas av_stream_new_side_data() does not. Should this be unified? libavformat/utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/utils.c b/libavformat/utils.c index e6158d8058..b12aff5eb0 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -5507,6 +5507,8 @@ uint8_t *av_stream_get_side_data(const AVStream *st, return st->side_data[i].data; } } + if (size) + *size = 0; return NULL; }