From patchwork Sat Jan 9 17:47:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 24866 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 D779744239D for ; Sat, 9 Jan 2021 19:49:05 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A420868A767; Sat, 9 Jan 2021 19:49:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3622A68A56C for ; Sat, 9 Jan 2021 19:48:59 +0200 (EET) Received: by mail-qv1-f41.google.com with SMTP id l7so5804095qvt.4 for ; Sat, 09 Jan 2021 09:48:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=UmvS+vYKJ8oKpFUAlhcHYQ67rTdbV1iq4/sUxyGLCZU=; b=WWe/UR40A5M8PddkMWiiEoQXHzlJiEP5poqr8dP5blsMwp0rSuSzTmooW19be5gL+x 5kT5lBaUKYVpB0onjI7FWf2ITqi8I7L4x0ruYOOYnf1St/pXk3cNMUJVdkoybL5TXDe/ GVBRFf1r5Ni5AGi2dhTkGT5q2KvjeQ9iRPVISjq/UL84KtzPGU914ndHBbmOoAgaOcMb BFqsHTSQWz8Zi57mE+Bjl2K/SS5lDW6/Ll8FbM8VFlpstzgu9FjMAbmZtYNqOvKemP4y tOo4tLUV6NjNlhkUrAde+WTFr3aOncyXKZw8HbJgdVq5TOhCRPZmqn4dC1HI3OY1d+9J TZJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=UmvS+vYKJ8oKpFUAlhcHYQ67rTdbV1iq4/sUxyGLCZU=; b=Mu+y3WPMxqYViosorgH8yTcpRhPf+KEuyZNil8FcdO7NQEzV8IXJN7ZqoilzxnIEu0 376OUYK0PRATg9Q5C6uQeag2paXEAhkhleh86cda7YJeBNUevjZrtqma6S4PDqzwjGwD WC6i2bmAfc4bTY2D/q9QzRRhnqQHsP8cvBDSSsGZebh+qBqIYvdHB4cLhQJCT1MygJSF 5HdxsPw1Ckoxdq4c4pVr3NLnYMFDB8zx5wv0s1LsAWWz6V+qmlzSmposG3NycsSYKYbi tzRe2wbxXCRcw1rcPAVYtLvQrI239wc5hLjP3EsVBVFo7F/+egONB6HS0CJuISJy0IsS 5oHw== X-Gm-Message-State: AOAM532IeKq1tGOWfdhlYa7t25lM0eZEzIwvv/1Zyki9aCrj6JvaTALa 3LtochwUwwbL7Z5v9oMbcoFIephrpoRHNg== X-Google-Smtp-Source: ABdhPJzICQlXQwEnUXA3A4vkVqQzIceuxQSJdWhzH1IxqCFZf0dMJNpG/bUWgo3d4Ie8gGJUcneAEA== X-Received: by 2002:a0c:80ca:: with SMTP id 68mr4798115qvb.28.1610214537479; Sat, 09 Jan 2021 09:48:57 -0800 (PST) Received: from localhost.localdomain ([191.84.231.154]) by smtp.gmail.com with ESMTPSA id 133sm6418360qkd.94.2021.01.09.09.48.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Jan 2021 09:48:56 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 9 Jan 2021 14:47:17 -0300 Message-Id: <20210109174717.535-1-jamrial@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] ffmpeg_opts: remove lowres check 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" The st->codec values are updated based on the lowres factor by avformat_find_stream_info() when it runs an instance of the decoder internally, and the same thing happens in ffmpeg.c when we open ist->dec_ctx with avcodec_open2(), so these assignments are redundant. Signed-off-by: James Almer --- This chunk here is not properly wrapped with the relevant pre-processor check for AVStream->codec, and seeing it's ultimately redundant, i figured we might as well delete it now. For that matter, the deprecation of lowres in avcodec.h is in a very strange state (the field is not removed, its offset is changed instead). Once the value of FF_API_LOWRES is flipped, neither the field, the AVOption, or the usage within decoders will be removed, but some code in libavformat/utils.c will be disabled, and that may result in unexpected behavior. fftools/ffmpeg_opt.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index c295514401..dec523d621 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -867,15 +867,6 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) case AVMEDIA_TYPE_VIDEO: if(!ist->dec) ist->dec = avcodec_find_decoder(par->codec_id); -#if FF_API_LOWRES - if (st->codec->lowres) { - ist->dec_ctx->lowres = st->codec->lowres; - ist->dec_ctx->width = st->codec->width; - ist->dec_ctx->height = st->codec->height; - ist->dec_ctx->coded_width = st->codec->coded_width; - ist->dec_ctx->coded_height = st->codec->coded_height; - } -#endif // avformat_find_stream_info() doesn't set this for us anymore. ist->dec_ctx->framerate = st->avg_frame_rate;