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 E26D545931 for ; Thu, 27 Apr 2023 14:26:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A2E7D68BF6E; Thu, 27 Apr 2023 17:26:15 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E909A68BEC0 for ; Thu, 27 Apr 2023 17:26:06 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id B2D482404F5 for ; Thu, 27 Apr 2023 16:26:06 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 5cQZKEErqJ6B for ; Thu, 27 Apr 2023 16:26:06 +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 45D302404EE 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 11F5B3A03E5 for ; Thu, 27 Apr 2023 16:26:05 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 27 Apr 2023 16:25:42 +0200 Message-Id: <20230427142601.2613-2-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 02/21] fftools/ffmpeg: reduce access to OutputStream.enc_ctx 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: It will be made private to Encoder in the future. --- fftools/ffmpeg.c | 7 +++---- fftools/ffmpeg_mux.c | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 15fe839914..1ae2c5c18f 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -649,8 +649,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC); av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC); for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { - const AVCodecContext * const enc = ost->enc_ctx; - const float q = enc ? ost->quality / (float) FF_QP2LAMBDA : -1; + const float q = ost->enc ? ost->quality / (float) FF_QP2LAMBDA : -1; if (vid && ost->type == AVMEDIA_TYPE_VIDEO) { av_bprintf(&buf, "q=%2.1f ", q); @@ -1155,7 +1154,7 @@ static int process_subtitle(InputStream *ist, AVSubtitle *subtitle, int *got_out for (int oidx = 0; oidx < ist->nb_outputs; oidx++) { OutputStream *ost = ist->outputs[oidx]; - if (!ost->enc_ctx || ost->enc_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE) + if (!ost->enc || ost->type != AVMEDIA_TYPE_SUBTITLE) continue; enc_subtitle(output_files[ost->file_index], ost, subtitle); @@ -1527,7 +1526,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo for (int oidx = 0; oidx < ist->nb_outputs; oidx++) { OutputStream *ost = ist->outputs[oidx]; - if (ost->enc_ctx || (!pkt && no_eof)) + if (ost->enc || (!pkt && no_eof)) continue; if (duration_exceeded) { diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index a19f1a1f1e..52f98fb76a 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -742,7 +742,7 @@ static void mux_final_stats(Muxer *mux) av_log(of, AV_LOG_VERBOSE, " Output stream #%d:%d (%s): ", of->index, j, av_get_media_type_string(type)); - if (ost->enc_ctx) { + if (ost->enc) { av_log(of, AV_LOG_VERBOSE, "%"PRIu64" frames encoded", ost->frames_encoded); if (type == AVMEDIA_TYPE_AUDIO) -- 2.39.2 _______________________________________________ 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".