From patchwork Fri May 8 10:52:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 19555 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 5EC474492B0 for ; Fri, 8 May 2020 13:52:54 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 385436883AE; Fri, 8 May 2020 13:52:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 382F2688200 for ; Fri, 8 May 2020 13:52:48 +0300 (EEST) Received: by mail-wm1-f52.google.com with SMTP id m24so125405wml.2 for ; Fri, 08 May 2020 03:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=r0dM6X1cXjkxfnMP9sZNBiIYtDxhb395kEHHuHA/5AM=; b=CDq2kvgw5L/RbRext01cGz/PlE/w0AnCWbbPK9cbMmB0gqEplxP8BH7fH5F23aIMjl txSTvrB/Y3450liHrKs3OOma6th91VQCF10B78Xms6VB74/YsDaoEDaERfaypZ4/uc6u Lxni6iMvLt65rG0/EatiF/Y0pyW3bizRg88Sp8g73kxksU+0WkqEj2oAkrlG6AErhgA3 8083J8gABeUiyF7ruaBJqJVyg3uUzTNKNuuMw1Boh7Nxtw+t/I1r+aARc+AhYfN5fsW2 lyfSPEYtHSLJ4VvXbT0UjZH7LGpe3T++Zor33NnnRyAAl7xMHXADlygHmR2+jt6O27w6 ueFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=r0dM6X1cXjkxfnMP9sZNBiIYtDxhb395kEHHuHA/5AM=; b=c0smSaCPpOUr+1mA9GqXtq7cuTasuRshWwnGN5hyduNZg63eBrESpl27KQMPC0ub6J KpEJoqbxfX2JZJ+kbdf1u6vItNPCHvOFCmpO5/l/Av1WW8hxsJJQRjXsUTKK6t6fS045 oOaIlJXb+9/mE3LwH9WuFMbW2vBxisptKyl+7dXpoM5ruOKksmQM14VsL/GBluG+FgWP UUriLsSO6SLQQPZJ/f6y68of8Il2q5onrYskUAwIieCIks3lAEO7VmDBaE+1g0xZhK++ 80+Uol4GTcEnJ6AxCGkSx0pfF+LMRCIb8Ad/jUBZtTlXAhM4aG86woTt/RUO4SdojA7s QwxQ== X-Gm-Message-State: AGi0Pua25yVDlB+bKHu1F4/qXiwymrRVpw/V4omj8Zjg9Rla7DqupwHa 0Fuc1eFjBps9tQW0dqNmg4di+q1T X-Google-Smtp-Source: APiQypKoFpPfdOG7Zz5R7UvFSdJwETjkYubCFZLLIGr8y+FTqfKC6kxLKAaZBgWXxlw/01J1OZS15A== X-Received: by 2002:a1c:9948:: with SMTP id b69mr14865793wme.44.1588935167166; Fri, 08 May 2020 03:52:47 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id y3sm2347527wrm.64.2020.05.08.03.52.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 03:52:46 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 8 May 2020 12:52:40 +0200 Message-Id: <20200508105240.15480-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/(null|opus)_bsf: Use ff_bsf_get_packet_ref() directly 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Rheinhardt --- The change to the documentation would be unnecessary if James' patch https://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/260984.html were applied. But it is only internal documentation, so changing and reverting it is easy. libavcodec/bsf.h | 2 +- libavcodec/null_bsf.c | 7 +------ libavcodec/opus_metadata_bsf.c | 7 +------ 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/libavcodec/bsf.h b/libavcodec/bsf.h index af035eee44..d04f1d3068 100644 --- a/libavcodec/bsf.h +++ b/libavcodec/bsf.h @@ -35,7 +35,7 @@ int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt); * @param ctx pointer to AVBSFContext of filter * @param pkt pointer to packet to move reference to * - * @return 0>= on success, negative AVERROR in case of failure + * @return 0 on success, negative AVERROR in case of failure */ int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt); diff --git a/libavcodec/null_bsf.c b/libavcodec/null_bsf.c index 24d26dfb1a..37f4640c87 100644 --- a/libavcodec/null_bsf.c +++ b/libavcodec/null_bsf.c @@ -24,12 +24,7 @@ #include "avcodec.h" #include "bsf.h" -static int null_filter(AVBSFContext *ctx, AVPacket *pkt) -{ - return ff_bsf_get_packet_ref(ctx, pkt); -} - const AVBitStreamFilter ff_null_bsf = { .name = "null", - .filter = null_filter, + .filter = ff_bsf_get_packet_ref, }; diff --git a/libavcodec/opus_metadata_bsf.c b/libavcodec/opus_metadata_bsf.c index 867ad830d3..d22db54f30 100644 --- a/libavcodec/opus_metadata_bsf.c +++ b/libavcodec/opus_metadata_bsf.c @@ -25,11 +25,6 @@ typedef struct OpusBSFContext { int gain; } OpusBSFContext; -static int opus_metadata_filter(AVBSFContext *bsfc, AVPacket *pkt) -{ - return ff_bsf_get_packet_ref(bsfc, pkt); -} - static int opus_metadata_init(AVBSFContext *bsfc) { OpusBSFContext *s = bsfc->priv_data; @@ -67,6 +62,6 @@ const AVBitStreamFilter ff_opus_metadata_bsf = { .priv_data_size = sizeof(OpusBSFContext), .priv_class = &opus_metadata_class, .init = &opus_metadata_init, - .filter = &opus_metadata_filter, + .filter = &ff_bsf_get_packet_ref, .codec_ids = codec_ids, };