From patchwork Fri Oct 9 13:04:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 22795 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 9AEF4449017 for ; Fri, 9 Oct 2020 16:10:15 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4521D68BA18; Fri, 9 Oct 2020 16:06:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.red.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E02BD68B9DA for ; Fri, 9 Oct 2020 16:06:38 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail.red.khirnov.net (Postfix) with ESMTP id E7C3429625B for ; Fri, 9 Oct 2020 15:06:34 +0200 (CEST) Received: from mail.red.khirnov.net ([IPv6:::1]) by localhost (mail.red.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id Tk6cE-1d46Xo for ; Fri, 9 Oct 2020 15:06:34 +0200 (CEST) Received: from libav.daenerys.khirnov.net (libav.daenerys.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.daenerys.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail.red.khirnov.net (Postfix) with ESMTPS id 8BEC229625E for ; Fri, 9 Oct 2020 15:06:31 +0200 (CEST) Received: by libav.daenerys.khirnov.net (Postfix, from userid 1000) id 965C920E0234; Fri, 9 Oct 2020 15:06:27 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 9 Oct 2020 15:04:24 +0200 Message-Id: <20201009130430.602-12-anton@khirnov.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201009130430.602-1-anton@khirnov.net> References: <20201009130430.602-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/18] lavf: move AVStream.probe_data to AVStreamInternal 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" Those are private fields, no reason to have them exposed in a public header. --- libavformat/avformat.h | 2 +- libavformat/internal.h | 2 ++ libavformat/utils.c | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index ef6d673699..c99449e121 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1061,10 +1061,10 @@ typedef struct AVStream { * last packet in packet_buffer for this stream when muxing. */ struct AVPacketList *last_in_packet_buffer; - AVProbeData probe_data; #if LIBAVFORMAT_VERSION_MAJOR < 59 // kept for ABI compatibility only, do not access in any way + AVProbeData unused6; int64_t unused5[16+1]; void *unused2; int unused3; diff --git a/libavformat/internal.h b/libavformat/internal.h index 23c2ce0dc3..b8e662b96e 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -336,6 +336,8 @@ struct AVStreamInternal { * - decoding: Set by libavformat to calculate sample_aspect_ratio internally */ AVRational display_aspect_ratio; + + AVProbeData probe_data; }; #ifdef __GNUC__ diff --git a/libavformat/utils.c b/libavformat/utils.c index 6cba0cce8f..27b7b62b1a 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -676,7 +676,7 @@ static void force_codec_ids(AVFormatContext *s, AVStream *st) static int probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt) { if (st->internal->request_probe>0) { - AVProbeData *pd = &st->probe_data; + AVProbeData *pd = &st->internal->probe_data; int end; av_log(s, AV_LOG_DEBUG, "probing stream %d pp:%d\n", st->index, st->probe_packets); --st->probe_packets; @@ -4342,6 +4342,8 @@ static void free_stream(AVStream **pst) av_bsf_free(&st->internal->bsfc); av_freep(&st->internal->priv_pts); av_freep(&st->internal->index_entries); + av_freep(&st->internal->probe_data.buf); + av_bsf_free(&st->internal->extract_extradata.bsf); av_packet_free(&st->internal->extract_extradata.pkt); @@ -4353,7 +4355,6 @@ static void free_stream(AVStream **pst) av_dict_free(&st->metadata); avcodec_parameters_free(&st->codecpar); - av_freep(&st->probe_data.buf); #if FF_API_LAVF_AVCTX FF_DISABLE_DEPRECATION_WARNINGS avcodec_free_context(&st->codec);