From patchwork Tue Dec 1 20:19:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 24222 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 DE9F444BA85 for ; Tue, 1 Dec 2020 22:31:51 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B49CF689ADE; Tue, 1 Dec 2020 22:31:51 +0200 (EET) 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 2F1F5689910 for ; Tue, 1 Dec 2020 22:31:43 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail.red.khirnov.net (Postfix) with ESMTP id 97C09296B23 for ; Tue, 1 Dec 2020 21:31:42 +0100 (CET) Received: from mail.red.khirnov.net ([IPv6:::1]) by localhost (mail.red.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 6-k6xC0ChPin for ; Tue, 1 Dec 2020 21:31:42 +0100 (CET) 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 mail.red.khirnov.net (Postfix) with ESMTPS id 24C89296B54 for ; Tue, 1 Dec 2020 21:31:37 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 3644F3A038D; Tue, 1 Dec 2020 21:20:15 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Dec 2020 21:19:45 +0100 Message-Id: <20201201201949.18834-5-anton@khirnov.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201201201949.18834-1-anton@khirnov.net> References: <20201201201949.18834-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/9] ffmpeg: stop accessing deprecated stream-embedded codec context 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" --- fftools/ffmpeg.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 80f436eab3..b446d9b206 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -3568,12 +3568,6 @@ static int init_output_stream(OutputStream *ost, AVFrame *frame, "Error initializing the output stream codec context.\n"); exit_program(1); } - /* - * FIXME: ost->st->codec should't be needed here anymore. - */ - ret = avcodec_copy_context(ost->st->codec, ost->enc_ctx); - if (ret < 0) - return ret; if (ost->enc_ctx->nb_coded_side_data) { int i; @@ -3618,8 +3612,6 @@ static int init_output_stream(OutputStream *ost, AVFrame *frame, // copy estimated duration as a hint to the muxer if (ost->st->duration <= 0 && ist && ist->st->duration > 0) ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base); - - ost->st->codec->codec= ost->enc_ctx->codec; } else if (ost->stream_copy) { ret = init_output_stream_streamcopy(ost); if (ret < 0) @@ -4011,7 +4003,7 @@ static int check_keyboard_interaction(int64_t cur_time) if (key == 'd' || key == 'D'){ int debug=0; if(key == 'D') { - debug = input_streams[0]->st->codec->debug<<1; + debug = input_streams[0]->dec_ctx->debug << 1; if(!debug) debug = 1; while(debug & (FF_DEBUG_DCT_COEFF #if FF_API_DEBUG_MV @@ -4034,7 +4026,7 @@ static int check_keyboard_interaction(int64_t cur_time) fprintf(stderr,"error parsing debug value\n"); } for(i=0;ist->codec->debug = debug; + input_streams[i]->dec_ctx->debug = debug; } for(i=0;i