From patchwork Thu Apr 27 14:26:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41371 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dca6:b0:f3:34fa:f187 with SMTP id ky38csp563920pzb; Thu, 27 Apr 2023 07:27:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zuY8Ah8ShUELMtxCUpJmJEFbOjtNRE5wtyVyJHQF5QN+GhH+Olms1dois98V1AAs5N28t X-Received: by 2002:aa7:d490:0:b0:506:adf0:ead5 with SMTP id b16-20020aa7d490000000b00506adf0ead5mr1703163edr.30.1682605677264; Thu, 27 Apr 2023 07:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682605677; cv=none; d=google.com; s=arc-20160816; b=Janp826vLVSUh/pjhe6vYtJeLUgc6WcCNxESORpvMXVLF8+Sks9/CgPhOjhgeEaWHR 47MzkClB3O/rdhwJCVDp6aqsbrXYIrRxnNu9SuuNqGqy18n2O6pZAFk7E5Sevs0c8azu hpO3gSW9by4zJpilAfKP9nRYLLwMrrTT+ZOq8TpJ2GJe7MpEEZ6n7r8P8wx7VD3mcOxF qhXsOpqAJwLlqB4B7XK8YpDTR9cK+Ww71RSsnDEbrDjSo+hjHNZN6V8ktlcjo2H1wK9W UKgjubgQWm82bTjgyrgHPaDvAX0L41VE09y/3lTp0Y9+H4fkAmZVVEqHOmaohnlUo/3X kRmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=2mpKbxXhPpNaSLGrJcMakwKrL2KTgYgrHwiacv8o8ek=; b=e3xwYgozqe8ZPaTvDfVCsFrsd7jIGtk0QVF5HlsFvbsnBO3w8BAM/WqAqTaTEiiLNj nylIOl6UFb5sBecqCAtErkHOtplxD/hDR/IG06QEnDDDHSgBnkVG3nvYwLToileZ/4Uc WprIvpq25Lq+EotEWrSFeNhfvlIpCFzuZvhpcv+OZQ44eGL1jtsYQeSVzG7SJx4juwu7 1udjbeKzG/GiT//J6Ou8OZWYZHfvgVkGIvZEJwHFOy4hI+nMGlF6urycOLWW5tYFdevm 5syZ+qtYutm348Wc6kjwEJ0w6W4YQFf9DYIjQCIJ4Tc8cesuIklslsRTRtKPBW3Ww3Th 4FuQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d17-20020aa7c1d1000000b00506a424a281si14200125edp.323.2023.04.27.07.27.50; Thu, 27 Apr 2023 07:27:57 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3B5CA68BFF3; Thu, 27 Apr 2023 17:26:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C17F268BEE4 for ; Thu, 27 Apr 2023 17:26:14 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 8D95E2404EC for ; Thu, 27 Apr 2023 16:26:14 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 8gksoxCpqdnT for ; Thu, 27 Apr 2023 16:26:14 +0200 (CEST) Received: from libav.khirnov.net (libav.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.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id EB84E240D1A for ; Thu, 27 Apr 2023 16:26:05 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id DDA673A03E5 for ; Thu, 27 Apr 2023 16:26:05 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 27 Apr 2023 16:26:00 +0200 Message-Id: <20230427142601.2613-20-anton@khirnov.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230427142601.2613-1-anton@khirnov.net> References: <20230427142601.2613-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 20/21] fftools/ffmpeg: constify packets passed to decode*() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Gp1X8lTCJvN8 They are not modified by these functions. --- fftools/ffmpeg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 83abc4e86e..07bd40749d 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -822,7 +822,7 @@ int ifilter_has_all_input_formats(FilterGraph *fg) // it again with pkt=NULL. pkt==NULL is treated differently from pkt->size==0 // (pkt==NULL means get more output, pkt->size==0 is a flush/drain packet) static int decode(InputStream *ist, AVCodecContext *avctx, - AVFrame *frame, int *got_frame, AVPacket *pkt) + AVFrame *frame, int *got_frame, const AVPacket *pkt) { int ret; @@ -952,7 +952,7 @@ static void audio_ts_process(InputStream *ist, AVFrame *frame) frame->time_base = tb_filter; } -static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output, +static int decode_audio(InputStream *ist, const AVPacket *pkt, int *got_output, int *decode_failed) { AVFrame *decoded_frame = ist->decoded_frame; @@ -1040,8 +1040,8 @@ static int64_t video_duration_estimate(const InputStream *ist, const AVFrame *fr return FFMAX(ist->last_frame_duration_est, 1); } -static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_t *duration_pts, int eof, - int *decode_failed) +static int decode_video(InputStream *ist, const AVPacket *pkt, int *got_output, + int64_t *duration_pts, int eof, int *decode_failed) { AVFrame *decoded_frame = ist->decoded_frame; int ret = 0, err = 0;