From patchwork Fri Jun 26 00:47:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 20613 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 6A6E244BC8F for ; Fri, 26 Jun 2020 03:47:43 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 34AE1687FF9; Fri, 26 Jun 2020 03:47:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5C75E687FAA for ; Fri, 26 Jun 2020 03:47:36 +0300 (EEST) Received: by mail-pj1-f47.google.com with SMTP id cm23so4195469pjb.5 for ; Thu, 25 Jun 2020 17:47:36 -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; bh=YmxS4jRh/2/r/VCAdRHgAXug3b8ml1m2rMtOT4jH5rQ=; b=fLx+8N/VhS+ogCDINJGP7IUXR9sU+pd4ZZuJiFTCEBTghJJIJI4eXQ352n+EPrUD6D 3CyjFbvayhnDPAy0Q8Q6rsYawyg5FQSKJmsAc2bZJY9lAD585yXgmxa0Amp7SkKGITjT 4kU9nW8E61ot3l+8BIUYgINBOQSOaDZyn3k9KoGmonuQI3nwtAkETPJ+i0Ic8A8XD1aZ YEgpFYl85bM/aoKRQi73cNdpCbnZ7Om1g1JHNBhMkpvq0Kk30yq89+gBOjT0yF/sjZq8 TTntc4OXGeaJnKDFrMnDGdizEH9tWyaNvXd4+J77N66m0bSFlKO2jCh0/PjNhGwdP5Ib z4Tw== 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; bh=YmxS4jRh/2/r/VCAdRHgAXug3b8ml1m2rMtOT4jH5rQ=; b=G4+YzBfFq5UlobfHOFVOB4wOWxdbZHCxc3eL0cxtU2XRJqADYvmrhayLe0ABQ/7o8i hXTt9QuLULaez3Ydi0meLPrbQD246FBw8jPnnE93DmLmDT3lshJ5ZUXf7YJt8AgCopu5 Fc2yx5EbSEbh3zPQNu7vioqumRL6VWEQT9i0Gqhdm20KUVUiDyzr0/zIKXDtcrr8YECk Uzg1IjMNji7moUqjZF4k9ppPhkFp0EMi+KGEkhJbroIb1Wh2eoLVOLTad4kQP7mX4gz2 RsmfF72ipPtUvZnwL51l1gM3+LxvC1vfabzUYIHGS+ujOKty7W1ivIoIJT6zIc/gwsNQ YVcg== X-Gm-Message-State: AOAM533aovs/DXG7IpIliYvk4SlPtQ6UJraXf/w/AwA976jsWxL7egE7 VQqwrQ4ozDRG2z/acKP56oApbF/S X-Google-Smtp-Source: ABdhPJxmX4+5Giy9P6VkDOxW8ftO8NIB4ofsLnyL+o0iK/LgOg66FmMqP0DepRnQgWZjLrWdc/yEDg== X-Received: by 2002:a17:902:724a:: with SMTP id c10mr379649pll.143.1593132453839; Thu, 25 Jun 2020 17:47:33 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id f20sm3942768pfn.51.2020.06.25.17.47.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jun 2020 17:47:32 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 26 Jun 2020 08:47:21 +0800 Message-Id: <1593132446-21202-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH 1/6] avcodec/dvbsubdec: simplify code by using OFFSET() macro 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavcodec/dvbsubdec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index f63a1f3..af6c78a 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1730,10 +1730,11 @@ end: } #define DS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_SUBTITLE_PARAM +#define OFFSET(x) offsetof(DVBSubContext, x) static const AVOption options[] = { - {"compute_edt", "compute end of time using pts or timeout", offsetof(DVBSubContext, compute_edt), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DS}, - {"compute_clut", "compute clut when not available(-1) or always(1) or never(0)", offsetof(DVBSubContext, compute_clut), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, DS}, - {"dvb_substream", "", offsetof(DVBSubContext, substream), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 63, DS}, + {"compute_edt", "compute end of time using pts or timeout", OFFSET(compute_edt), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DS}, + {"compute_clut", "compute clut when not available(-1) or always(1) or never(0)", OFFSET(compute_clut), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, DS}, + {"dvb_substream", "", OFFSET(substream), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 63, DS}, {NULL} }; static const AVClass dvbsubdec_class = {