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 1F9B84768F for ; Tue, 19 Sep 2023 19:22:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 73C4568C976; Tue, 19 Sep 2023 22:21:20 +0300 (EEST) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4D90968C926 for ; Tue, 19 Sep 2023 22:21:19 +0300 (EEST) Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id F2AB610 for ; Tue, 19 Sep 2023 21:21:18 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id xtRQZ9Dx_QO0 for ; Tue, 19 Sep 2023 21:21:13 +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 mail1.khirnov.net (Postfix) with ESMTPS id A43EF515C for ; Tue, 19 Sep 2023 21:20:42 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 988EC3A0212 for ; Tue, 19 Sep 2023 21:20:42 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Sep 2023 21:10:40 +0200 Message-Id: <20230919191044.18873-14-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230919191044.18873-1-anton@khirnov.net> References: <20230919191044.18873-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/27] fftools/ffmpeg_enc: constify the frame passed to enc_open() 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- fftools/ffmpeg.h | 2 +- fftools/ffmpeg_enc.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index 15790d3e0c..0983d026cd 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -817,7 +817,7 @@ int dec_packet(InputStream *ist, const AVPacket *pkt, int no_eof); int enc_alloc(Encoder **penc, const AVCodec *codec); void enc_free(Encoder **penc); -int enc_open(OutputStream *ost, AVFrame *frame); +int enc_open(OutputStream *ost, const AVFrame *frame); int enc_subtitle(OutputFile *of, OutputStream *ost, const AVSubtitle *sub); int enc_frame(OutputStream *ost, AVFrame *frame); int enc_flush(void); diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 321554ab5c..c300a11f28 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -165,7 +165,7 @@ static int set_encoder_id(OutputFile *of, OutputStream *ost) return 0; } -int enc_open(OutputStream *ost, AVFrame *frame) +int enc_open(OutputStream *ost, const AVFrame *frame) { InputStream *ist = ost->ist; Encoder *e = ost->enc; @@ -183,9 +183,8 @@ int enc_open(OutputStream *ost, AVFrame *frame) av_assert0(frame || (enc->type != AVMEDIA_TYPE_VIDEO && enc->type != AVMEDIA_TYPE_AUDIO)); if (frame) { - fd = frame_data(frame); - if (!fd) - return AVERROR(ENOMEM); + av_assert0(frame->opaque_ref); + fd = (FrameData*)frame->opaque_ref->data; } ret = set_encoder_id(output_files[ost->file_index], ost); -- 2.40.1 _______________________________________________ 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".