From patchwork Thu Nov 2 22:39:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Frattaroli X-Patchwork-Id: 5834 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp2664092jah; Thu, 2 Nov 2017 15:41:02 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QTuEbEqfR0zreV21+X32avwmCO2n76V57SNtTZMU6uyfk5Kr/bZKpMEeSQHNo/DrX3eLQk X-Received: by 10.223.176.82 with SMTP id g18mr401724wra.234.1509662462170; Thu, 02 Nov 2017 15:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509662462; cv=none; d=google.com; s=arc-20160816; b=cV1Y8a/jez13XR4O0fI3qiTdRkYXoj6k2D9vviF2WPfDB9CL+dU/XStx6MZF4iFBnO d75+S/9qQiSKxDRrbDx+aLgQthSG5E0PQWXVv7uiPGeC3EADhTZF0A0m/G3hRtDnyqiu ClbiHhbHI4//NE1XOLzh8d1uR/Q/lFI7DV8T/pZNyeaPkw0lmN0imjV/x6zm1UShs802 1GwWsijv262cjodNvbHE8KCQEt8T2K64dfjU5TX8BMqaPAPp0NEBxNjQA27OoZdY/Dil /56Upq0SWSvzr6465JebR79b7mI0FowDskT4PHKsZUUxOrZHoJ+DCH50H5FKfSaOwfJp VdlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=5cIK2alnLO9ZcquEPaHqhfM8j6r4g2z/2HyijLPOGPU=; b=nlw+AsE9evlN72tHKyff9q8uq1QCzApCjnczeG1PUAeYbTcnwjwL8eA6GBKWQuWfJf /jMi+SPchqpnbvL/cZKu/corQFxq8Tdj1BLqpKVP9pzRItFwqW5vvX/xoFvAdoCcQ1BO /5w9XssglEaKkqh6zA+o175p/UyVGBjPWx/HdcVdhRDIwMtAAOtVuLqCX9PNxqmOmPXO dOGNgefh5iqIW3kjIwpdCyJVQ3igtFLZS4A3p5A6UgJV/lflxmrOIjDrWKd4IBEx0nc3 3Iyw0S6FcgZOEkgTU46vPCLZTm6ldDlM4KrvzW1sPjuBGC4ktE/++j8+vWwl5B2o3THN +5fQ== 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 z92si3737550wrb.71.2017.11.02.15.41.00; Thu, 02 Nov 2017 15:41:02 -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 66918689C17; Fri, 3 Nov 2017 00:40:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from fratti.ch (i.am.not.fratti.ch [188.40.42.86]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B5F16689221 for ; Fri, 3 Nov 2017 00:40:42 +0200 (EET) From: Nicolas Frattaroli Authentication-Results: fratti.ch; dkim=permerror (bad message/signature format) To: ffmpeg-devel@ffmpeg.org Date: Thu, 2 Nov 2017 23:39:53 +0100 Message-Id: <20171102223953.4294-1-ffmpeg@fratti.ch> X-Mailer: git-send-email 2.14.3 Subject: [FFmpeg-devel] [PATCH] diracdec: fix deprecated API usage 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 Cc: Nicolas Frattaroli MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" avcodec_get_chroma_sub_sample is deprecated and generates a warning during build, so av_pix_fmt_get_chroma_sub_sample is used Signed-off-by: Nicolas Frattaroli --- libavcodec/diracdec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 0abb8b0599..7f83ed47f2 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -26,6 +26,7 @@ * @author Marco Gerards , David Conrad, Jordi Ortiz */ +#include "libavutil/pixdesc.h" #include "libavutil/thread.h" #include "avcodec.h" #include "get_bits.h" @@ -1927,7 +1928,10 @@ static int get_buffer_with_edge(AVCodecContext *avctx, AVFrame *f, int flags) { int ret, i; int chroma_x_shift, chroma_y_shift; - avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_x_shift, &chroma_y_shift); + ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_x_shift, + &chroma_y_shift); + if (ret) + return ret; f->width = avctx->width + 2 * EDGE_WIDTH; f->height = avctx->height + 2 * EDGE_WIDTH + 2; @@ -2126,7 +2130,11 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int s->pshift = s->bit_depth > 8; - avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift, &s->chroma_y_shift); + ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, + &s->chroma_x_shift, + &s->chroma_y_shift); + if (ret) + return ret; ret = alloc_sequence_buffers(s); if (ret < 0)