From patchwork Fri Jan 7 04:49:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 33139 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp79410iog; Thu, 6 Jan 2022 20:49:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaUKaZnKqk7OaGIXjPq4a6UrUtkvV04qEcpl05seiY2X7Y72ekbWoF9TCAoJM++WMT33+y X-Received: by 2002:a17:907:1b0d:: with SMTP id mp13mr48339781ejc.29.1641530990588; Thu, 06 Jan 2022 20:49:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641530990; cv=none; d=google.com; s=arc-20160816; b=ZRUG7shm5G/PypobrP5ZhPnRP0ws4cULq/BgPbEtpvYsCP45Cjk3xYuD24U9pT0vzI TmfVV/A07bym6Xm1lU8M2B0N8rx+HRyCsHgxntvL6N4PFuCjxTL6WFrOh/IvNytyL45y CyK1S+dPppUMFeNiXdoX9E+QnAPApCWAipdBWLWVbq1XNRrX0nId3EtM117eptdHJAhy 0b3kYiL2qWwHD5DUWXXamFT4ky3D9z7GZjQK6AtUiQJ2OFA42XW855YWTznZ6R4CHCnP RsN9AQtFRo07LY9Xt7xCOotLLNsw6tc2eqkS7gW/r/19VEiY2dHsKeR1VDE/UZeuG5cl MTOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:to:mime-version:fcc:date:from:references :in-reply-to:message-id:dkim-signature:delivered-to; bh=qEgqa/ovD3bgN9yx/yDXBkEvfhzDt2Q2Dl9UA34pbns=; b=jR9VixH51ncHzPMRMT5+bad5i27kuac426vrbGvsRG/nbaP6IuGvXanGRUzbJ3LEY8 XYdmwfa87v5eorfjIkwa9Q+uF3APbyOks6N1jcpF/hkg/ylsakALz+6Lpdsw22xx3HH8 MJIOjS0AYgxonn3/+hlRx62cruXG6P2mHRxit53/B0k4CcPoO2A4/8/r/YIwZTkgm/5F yUmo0NQ4wgMl/8Jca0XliglnHCxUbRtLcVjudQVYmAx3flys65I76MlbyqNvzAAFvQZX C8Auv5arFzG5AQjwvgkHRo+uXIXbU1PI8pYK67VxmhsICw5xeg39Wg8iYy1RbDG8zWww btBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=V3wH1HpQ; 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=QUARANTINE 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 n26si2074225edr.134.2022.01.06.20.49.50; Thu, 06 Jan 2022 20:49:50 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=V3wH1HpQ; 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=QUARANTINE 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 D4C8D68A8FA; Fri, 7 Jan 2022 06:49:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9840968073D for ; Fri, 7 Jan 2022 06:49:29 +0200 (EET) Received: by mail-pg1-f182.google.com with SMTP id y9so4448807pgr.11 for ; Thu, 06 Jan 2022 20:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=4nf2r2d6QoM0XjZ2DhHtaCdSmXWR2DaX6esRC1bunWs=; b=V3wH1HpQMZxIMhcjukWNA7kJjIJnLoh94Df/4YsC8686Mvt2M4DN4/B81VY8rZWxZe RLpyh96XdGlDY0DQHGEru0ulXphKwbsfoyvLV23l5ZinGYSO9xxhpppMY5f02Gbox6U5 eLOUAXIWwuJ1g2Ob6PczPxDm2vqMORGB7rEt1wLlnzwr5xzKkrugzSnyTRCmtkPqYfW+ pyzMAwaK3789h2tbAzsWVX1o9RmtE4drYRtdriqykwRHVvyy/6v/GE+GbaLJApujlZrV NaqJwjucIbo3Q1sDUV6fcbcpfEMe76BBRZ8xSB0ulIhGcW6N5+m/KxXJLsCTM664gtrG Ny6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=4nf2r2d6QoM0XjZ2DhHtaCdSmXWR2DaX6esRC1bunWs=; b=TUpQpQRUgNVAuT2uVAqWEi77tmg0vtJUnJyyN0kPm4q9jtNIOWCE9RiHiSlTtLQGup T1RQqAItWUyE5nR1kkHGkRj1B5u7SW7eD+DHM+GzT3D3oWT2ASTT9NM/DCqnK+GdkYut gti9PAl8QvM2bGH2qRTVgdYCznP8drQUC2mXsUE+7vO2IHH9wYAdiIxTh55wE3aCOPAw dMm7H/t3Vz+8dVnK9HBl7aU93lWycq4FiNT6ZyJ3mRo6qDKkkkcrRRcHREMDkA9aVxdd nkNfgTSs+0M9m9NA1ebULBlEEYFQ0t2FDN0O3WDvWAp9B4TSH6W9PNnTLCdKHH/CCQah 88cg== X-Gm-Message-State: AOAM533aLf5CR7XZRcj63qpsL7xFVmrrAfi4LEfbsAVzrI+u1n00okRb W2Tby8jWWff44IWyLjosccB/KP2wN/6NKA== X-Received: by 2002:a05:6a00:d64:b0:4ba:cb6f:87e0 with SMTP id n36-20020a056a000d6400b004bacb6f87e0mr63091650pfv.72.1641530968095; Thu, 06 Jan 2022 20:49:28 -0800 (PST) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id w2sm3175367pgt.93.2022.01.06.20.49.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jan 2022 20:49:27 -0800 (PST) Message-Id: <6ca8905c3d9883f59851083b55817db194315c93.1641530966.git.ffmpegagent@gmail.com> In-Reply-To: References: From: ffmpegagent Date: Fri, 07 Jan 2022 04:49:23 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 1/4] avcodec/dvbsubdec: don't dump images to disk based on DEBUG define 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 Cc: softworkz Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: USenCw13xOVP From: softworkz It's been a regular annoyance. Introduce a debug-only parameter for this. Signed-off-by: softworkz --- libavcodec/dvbsubdec.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index bc741a1de6..8db9963fda 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -137,6 +137,9 @@ typedef struct DVBSubContext { DVBSubRegionDisplay *display_list; DVBSubDisplayDefinition *display_definition; +#ifdef DEBUG + int dump_imgs; +#endif } DVBSubContext; @@ -1534,11 +1537,11 @@ static int save_display_set(DVBSubContext *ctx) } - snprintf(filename, sizeof(filename), "dvbs.%d", fileno_index); - - png_save(ctx, filename, pbuf, width, height); - - av_freep(&pbuf); + if (ctx->dump_imgs) { + snprintf(filename, sizeof(filename), "dvbs.%d", fileno_index); + png_save(ctx, filename, pbuf, width, height); + av_freep(&pbuf); + } } fileno_index++; @@ -1730,6 +1733,9 @@ static const AVOption options[] = { {"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 only once (-2) or always(1) or never(0)", OFFSET(compute_clut), AV_OPT_TYPE_BOOL, {.i64 = -1}, -2, 1, DS}, {"dvb_substream", "", OFFSET(substream), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 63, DS}, +#ifdef DEBUG + { "dump_imgs", "Dump subtitle images to disk", OFFSET(dump_imgs), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DS}, +#endif {NULL} }; static const AVClass dvbsubdec_class = {