From patchwork Wed Nov 1 18:01:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 5818 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp1069797jah; Wed, 1 Nov 2017 11:01:41 -0700 (PDT) X-Google-Smtp-Source: ABhQp+T/l0XzJDhY5mp17iPFZHClhtCympP8g78btYqXkC0iMFT8KCshHV07gYCUrsOv1XjJ+wMz X-Received: by 10.28.199.4 with SMTP id x4mr774196wmf.124.1509559301226; Wed, 01 Nov 2017 11:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509559301; cv=none; d=google.com; s=arc-20160816; b=UGapA+KrXiIk2NTmLegUbpdtABvmqep7JqtzDaPZG8uu4iA9Xd8SZzsaJxGq1Gtcs3 vPcd7Olk4eFuLRXeV/UX2ERS86Pfo9laZZYhK8bo+75nw7ZiCIgVh6G5zObNzmtSqJFZ egLygK8dKzbHXx+Tvom60GBLQRVCGAGe7yKcI4H0/F3qQES90CmYQV0J1ut014MWXWJX w1g13PC7VYyfTJnuRQaZE3Pgo2y2U+mQX0Unvsy7Z/TZcOpq+Tr27ztsfAs5oaUcYYbx 9EjDZWqVaj93LqSubzosyBmhLKLTbc6OM3VvAsmPUI7NIyOG76utrZ29cFMg/HSQ75O/ srQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:delivered-to:arc-authentication-results; bh=iF4Oglc+f0E6Ap9dXxwkNULxbJhFzY06N33Yq6g0kr0=; b=lYd0bfTjlN2AUCET1i0XOJFJyl/iwqIjsV+zPqiLsmj1hWdcMAnqzPHsG3MOV00BDh lWwTlyVLQcwbWI74xa5hPeNys2kAecNbnkQeGfffoyMYyNB9v6dUmvUNIPCNEf1mTr6H 1BgvPJ60vAb3gc+gguwBd/Jy2J2htED1YbuSkGJfr7HWlhLHS9sWbwdlQZacQBCXIO0k 4EkKNV2Fijgr4M/yxsbCZHCqEIAaF9PWESW8QltITXMJgrsm8X4JZ+mXWu3QfbJX3izf s/YAxyE29G8dhnLx/WNDVY1SxsHi5xD8+sEQwI1+TdceTHE5awvUdVxMxZ1oWKbXaNMO aUlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=bfPistnn; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x51si1043703wrb.430.2017.11.01.11.01.40; Wed, 01 Nov 2017 11:01:41 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=bfPistnn; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 71A9168A144; Wed, 1 Nov 2017 20:01:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0102E68A11C for ; Wed, 1 Nov 2017 20:01:21 +0200 (EET) Received: by mail-io0-f176.google.com with SMTP id 101so7949643ioj.3 for ; Wed, 01 Nov 2017 11:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=l1vSLX3kDDhl5IugWeHM3JEA/79OjPE7vecdxJ3UOhc=; b=bfPistnnsEGibqwGqOUVmwQq1ZGGyjYsmEFJmDkyt1rH9ALWuChFIWGdtfBgTp0PuN OuNyKU70DWeGydcPbidWE791l92rBiSnLEhkel1BO1/hGnvf2bnXVkXO4p6sLZsB3HDN AcBbR8J0mDvl7+778wR4JU6MGV94GRSJMwb3OCgG4zClyiq5vEYrl8/89PtpAfPFQe5k y5c0Jac1Pyb2OkYehG5xzlAPV/VQqfmzZnzbiuEJcKHatjRu6i+8+gWxMuaDpXuKnkY7 6RwtKiKneYgMVL1vv135wHo6qxFYZkfEz39OlqENDPdiYu5qpF2/SSjzF89eNWCNz6sp gKuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=l1vSLX3kDDhl5IugWeHM3JEA/79OjPE7vecdxJ3UOhc=; b=nxd/ouCVILZI40GhPvJT2B2zR+Asf9ETj5Isce1ZaqIGmTrkL0ABHZOQCMmVRjOniu dkYZwTZrvPiQ0lqiSPdO0V58fiAQ4EDwRv7N73weAXu4kq6NybC6R3F33r4Aksitkbj8 gRXMQ8NserBNCHz/0oAo3TFyUt+525yb2Eh0K1wAZgmaaGeRGVCuhpiBxvCzlhouxDQB aatKBbJwl2gwQ9hRokpQuQUNkWURt0mZnKwLkxVDWyFSUCXtUf0FqzcJqA7FQaOrz0zY MXvBpQHDs06zzh+XXtkDxh/KKtRu8fKImeK7YmBKbOl4sRF8js+mWMiJ+FBxDpNvOpdX haAw== X-Gm-Message-State: AJaThX5tj15C33qmHzsbc2jxc+Pda3No0+jjgWjMP6WEOjlemB6g/oAm UfjG/3BR1k68squpJh63hButAHNS0slgcM+57yk= X-Received: by 10.107.138.222 with SMTP id c91mr953386ioj.246.1509559290815; Wed, 01 Nov 2017 11:01:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.63.101 with HTTP; Wed, 1 Nov 2017 11:01:10 -0700 (PDT) In-Reply-To: References: From: Carl Eugen Hoyos Date: Wed, 1 Nov 2017 19:01:10 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH]lavc/pcm-bluray: Do not use incompatible pointers on big-endian. 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" 2017-11-01 18:31 GMT+01:00 Hendrik Leppkes : > On Wed, Nov 1, 2017 at 6:25 PM, Carl Eugen Hoyos wrote: >> 2017-11-01 18:16 GMT+01:00 Hendrik Leppkes : >>> On Wed, Nov 1, 2017 at 5:16 PM, Carl Eugen Hoyos wrote: >>>> Hi! >>>> >>>> Attached patch silences two gcc warnings, no sample for odd channel count found. >>>> >>>> #if HAVE_BIGENDIAN >>>> - bytestream2_get_buffer(&gb, dst16, avctx->channels * 2); >>>> - dst16 += avctx->channels; >>>> + uint8_t *dst = frame->data[0]; >>>> + bytestream2_get_buffer(&gb, frame->data[0], avctx->channels * 2); >>>> + dst += avctx->channels * 2; >>>> #else >>>> channel = avctx->channels; >>>> do { >>> >>> This hunk seems fishy. dst is only ever set, never read, and this code >>> is executed in a loop but always writes to the same position. >> >> I had sent the wrong version, please review this one. > > That still won't work, dst is declared within the loop, so its reset > back to the start at the beginning of the frame each iteration. New try attached. Thank you, Carl Eugen From 37cdd3738a68090330611e4f5aa666f8213b5a95 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Wed, 1 Nov 2017 18:59:26 +0100 Subject: [PATCH] lavc/pcm-bluray: Do not use incompatible pointers on big-endian. Fixes the following gcc warnings: libavcodec/pcm-bluray.c:172:45: warning: passing argument 2 of 'bytestream2_get_buffer' from incompatible pointer type libavcodec/pcm-bluray.c:192:49: warning: passing argument 2 of 'bytestream2_get_buffer' from incompatible pointer type --- libavcodec/pcm-bluray.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/pcm-bluray.c b/libavcodec/pcm-bluray.c index 517d7b5..91bcfb1 100644 --- a/libavcodec/pcm-bluray.c +++ b/libavcodec/pcm-bluray.c @@ -169,7 +169,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, void *data, samples *= num_source_channels; if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) { #if HAVE_BIGENDIAN - bytestream2_get_buffer(&gb, dst16, buf_size); + bytestream2_get_buffer(&gb, frame->data[0], buf_size); #else do { *dst16++ = bytestream2_get_be16u(&gb); @@ -187,10 +187,11 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, void *data, case AV_CH_LAYOUT_2_1: case AV_CH_LAYOUT_5POINT0: if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) { + uint8_t av_unused *dst = frame->data[0]; do { #if HAVE_BIGENDIAN - bytestream2_get_buffer(&gb, dst16, avctx->channels * 2); - dst16 += avctx->channels; + bytestream2_get_buffer(&gb, dst, avctx->channels * 2); + dst += avctx->channels * 2; #else channel = avctx->channels; do { -- 1.7.10.4