From patchwork Fri Dec 31 10:53:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 32959 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp13864652iog; Fri, 31 Dec 2021 02:54:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGLmqll6aARyK0QHejEe73JTdhqopSwhKb+zUAk0DCXtoPvQrSnJcFfsGSQ0Xco7e+Kxcu X-Received: by 2002:a05:6402:491:: with SMTP id k17mr34091546edv.333.1640948053628; Fri, 31 Dec 2021 02:54:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640948053; cv=none; d=google.com; s=arc-20160816; b=P3W6waiXvplHTsfhsgHFnSPDVt1OAb7dXa7BksZrd981lBQwiW01YMm5mzhTtZRurE fIM9xZj4YESV9uZH4lsAMZBbQXGBu306o48exLjUn14suc15a1o+EJyFbUkdPouzk0YQ 3yD0n3IRNTQJAuWC/5wO1BBqf5mF4Ag9EX86NtsSJE6s2fTNUW3KhdqVkQjt8US7IKTH m9c5a/AedxpEFztiAr67qfg47bGKKeGWqCBdjutwiTEk6MjL0UbMtKZunVhr15SEkm6L bxJgAHYPRr141dELP8OH/wy/Kz+UNzQze2d3+cQARYVHNMZC5T4REDrAyLhaNK4MJR4n d4Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=7W120TG5xmoT5CuIuzCmKvdGVVxlYulZza0WppJEYUs=; b=t6/kD+H+fqp+my58QZtNJWFuIsgZ9ySoxsQXpX+PyfZt1kcYlAgAFXho0HIYr+o1iu eIrK7+epa7S4c2n+CQPwUwATN+Q4pqs/K36KbOyVG1wjrO+bSRTVQtrbJJsr2US2keV4 hxOqBv2Zd6qcB2Q1vOxH2n4fn/ik3X2iCA9OhOWCCS9oAd3ocK1mMfr11ujSaxdxr7Yz +RUnMZTSI4raI1FvvkQtrT4j3FoiA6PY4zBuxWW8I71CqA1MmokF+s47DLtnHI9EwDwY uQyEVBgOgsIJBsXCQz00NFDwvlQWkHlNRcQ9sVkwyCrNMHLcxH7UThmN9t7a96RUygF4 m6SQ== 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 i22si15908506ejw.575.2021.12.31.02.54.13; Fri, 31 Dec 2021 02:54:13 -0800 (PST) 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 B68DB68AFFF; Fri, 31 Dec 2021 12:53:33 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4B9C368AF97 for ; Fri, 31 Dec 2021 12:53:23 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 5B55B24017E for ; Fri, 31 Dec 2021 11:53:22 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id ABfzB3UaTbso for ; Fri, 31 Dec 2021 11:53:22 +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 mail0.khirnov.net (Postfix) with ESMTPS id 9AC58240506 for ; Fri, 31 Dec 2021 11:53:19 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 970BB3A038E; Fri, 31 Dec 2021 11:53:19 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 31 Dec 2021 11:53:02 +0100 Message-Id: <20211231105307.30946-2-anton@khirnov.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211231105307.30946-1-anton@khirnov.net> References: <20211231105307.30946-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/7] lavf/dvenc: replace av_fifo_peek2() with av_fifo_generic_peek_at() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: PIAlAr1v0MKT This is the only remaining caller of av_fifo_peek2(), which will be deprecated. --- libavformat/dvenc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c index 9a853ba7ce..b76539b59f 100644 --- a/libavformat/dvenc.c +++ b/libavformat/dvenc.c @@ -201,8 +201,9 @@ static void dv_inject_audio(DVMuxContext *c, int channel, uint8_t* frame_ptr) if (of*2 >= size) continue; - frame_ptr[d] = *av_fifo_peek2(c->audio_data[channel], of*2+1); // FIXME: maybe we have to admit - frame_ptr[d+1] = *av_fifo_peek2(c->audio_data[channel], of*2); // that DV is a big-endian PCM + // FIXME: maybe we have to admit that DV is a big-endian PCM + av_fifo_generic_peek_at(c->audio_data[channel], frame_ptr + d, of * 2, 2, NULL); + FFSWAP(uint8_t, frame_ptr[d], frame_ptr[d + 1]); } frame_ptr += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */ }