From patchwork Thu Apr 13 14:12:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41165 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4645:b0:e3:3194:9d20 with SMTP id eb5csp1290213pzb; Thu, 13 Apr 2023 07:20:14 -0700 (PDT) X-Google-Smtp-Source: AKy350a9KCo9cTZshxuv61dvjtnNUWSqE/YVCDds31m34FJPAkk86PRx+K1WO9MPcPO8n+MOfvI5 X-Received: by 2002:a17:906:3159:b0:932:1af9:7386 with SMTP id e25-20020a170906315900b009321af97386mr2803143eje.27.1681395614403; Thu, 13 Apr 2023 07:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681395614; cv=none; d=google.com; s=arc-20160816; b=Ysp3pF/EJQIsAkxMeUS938zQPoi4E6eGQIcpBYpsdjqfiY8btXCZCrDMUcPiwB9UPr t4pUOFGBUI/rt8cJEUzocZxSx2y6gg5xSgYyUj0zgrtzrcSW2JIsQMkaDukOrS9B9dTR aZ/4Unbc1o+Gjaj9IYni1zhzZMcMdEhU5W0XXSH3hM3Yu2GielYrR38M/NrEJv4jDK4S gvszPttLrUTD3N/Bc518TukrDxzcLG5LdgIYStKryTrWsKQmHetYzQVCF13EqXf74puq L40NIhl6+9/vhMraVeTI4u9Go8Ah9mqBnf/72VM41o93ulGsOGh5UDzsXgwQLks2hwcL lC5g== 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=HvTUswTv9sJsigdqYw6Itul3KVyKXKh0TPganZt2klM=; b=OqMPZ9ehLoJSwynF9UyYN4QHWdH9+UH+iTs0Tan64okdRDdjk8pSd01XJLA/ixu569 OQTYnPxpc/wzxpU+VuNKGwJgVAnltNIGhFQ7k21qatSSYtb9ZA2DROkfioDVIwby+/6M 9IPiq9vFAq5cxnrcpCseHrsrBX6Odb0re1GoYk7gSslqwDsaGQqrLoxIPYJJ98qWUoZG tX7kyPhoCaKum7TaOF8JwwbnLHA8R33i9WHYqtzaqZ0KkxezON/UGq9DYxWomkTgfcw0 yvMKcyZFJXHy+kIomoc/Wz5riBa62MMRGfub7OAg5cpSJMUg5Yb4dtCVW87oD9YpV84G 95hg== 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 fg1-20020a1709069c4100b0094bcb53bc1dsi1911895ejc.1048.2023.04.13.07.20.14; Thu, 13 Apr 2023 07:20:14 -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; 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 10BC068BEF5; Thu, 13 Apr 2023 17:16:19 +0300 (EEST) 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 DB45B68BE53 for ; Thu, 13 Apr 2023 17:16:00 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id CE4D92406CE for ; Thu, 13 Apr 2023 16:15:59 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id camQMyObnyi4 for ; Thu, 13 Apr 2023 16:15:59 +0200 (CEST) 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 638772406CD for ; Thu, 13 Apr 2023 16:15:53 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 525AF3A039B for ; Thu, 13 Apr 2023 16:15:53 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 Apr 2023 16:12:10 +0200 Message-Id: <20230413141223.17245-12-anton@khirnov.net> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230413141223.17245-1-anton@khirnov.net> References: <20230413141223.17245-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 12/25] fftools/ffmpeg_dec: reindent after previous commit 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: /tXlZ376monF --- fftools/ffmpeg_dec.c | 80 ++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index ccf558649c..d6fd0de126 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -83,53 +83,53 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat int dec_open(InputStream *ist) { - const AVCodec *codec = ist->dec; + const AVCodec *codec = ist->dec; int ret; - if (!codec) { - av_log(ist, AV_LOG_ERROR, - "Decoding requested, but no decoder found for: %s\n", - avcodec_get_name(ist->dec_ctx->codec_id)); - return AVERROR(EINVAL); - } + if (!codec) { + av_log(ist, AV_LOG_ERROR, + "Decoding requested, but no decoder found for: %s\n", + avcodec_get_name(ist->dec_ctx->codec_id)); + return AVERROR(EINVAL); + } - ist->dec_ctx->opaque = ist; - ist->dec_ctx->get_format = get_format; + ist->dec_ctx->opaque = ist; + ist->dec_ctx->get_format = get_format; - if (ist->dec_ctx->codec_id == AV_CODEC_ID_DVB_SUBTITLE && - (ist->decoding_needed & DECODING_FOR_OST)) { - av_dict_set(&ist->decoder_opts, "compute_edt", "1", AV_DICT_DONT_OVERWRITE); - if (ist->decoding_needed & DECODING_FOR_FILTER) - av_log(NULL, AV_LOG_WARNING, "Warning using DVB subtitles for filtering and output at the same time is not fully supported, also see -compute_edt [0|1]\n"); - } + if (ist->dec_ctx->codec_id == AV_CODEC_ID_DVB_SUBTITLE && + (ist->decoding_needed & DECODING_FOR_OST)) { + av_dict_set(&ist->decoder_opts, "compute_edt", "1", AV_DICT_DONT_OVERWRITE); + if (ist->decoding_needed & DECODING_FOR_FILTER) + av_log(NULL, AV_LOG_WARNING, "Warning using DVB subtitles for filtering and output at the same time is not fully supported, also see -compute_edt [0|1]\n"); + } - /* Useful for subtitles retiming by lavf (FIXME), skipping samples in - * audio, and video decoders such as cuvid or mediacodec */ - ist->dec_ctx->pkt_timebase = ist->st->time_base; - - if (!av_dict_get(ist->decoder_opts, "threads", NULL, 0)) - av_dict_set(&ist->decoder_opts, "threads", "auto", 0); - /* Attached pics are sparse, therefore we would not want to delay their decoding till EOF. */ - if (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC) - av_dict_set(&ist->decoder_opts, "threads", "1", 0); - - ret = hw_device_setup_for_decode(ist); - if (ret < 0) { - av_log(ist, AV_LOG_ERROR, - "Hardware device setup failed for decoder: %s\n", - av_err2str(ret)); - return ret; - } + /* Useful for subtitles retiming by lavf (FIXME), skipping samples in + * audio, and video decoders such as cuvid or mediacodec */ + ist->dec_ctx->pkt_timebase = ist->st->time_base; + + if (!av_dict_get(ist->decoder_opts, "threads", NULL, 0)) + av_dict_set(&ist->decoder_opts, "threads", "auto", 0); + /* Attached pics are sparse, therefore we would not want to delay their decoding till EOF. */ + if (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC) + av_dict_set(&ist->decoder_opts, "threads", "1", 0); + + ret = hw_device_setup_for_decode(ist); + if (ret < 0) { + av_log(ist, AV_LOG_ERROR, + "Hardware device setup failed for decoder: %s\n", + av_err2str(ret)); + return ret; + } - if ((ret = avcodec_open2(ist->dec_ctx, codec, &ist->decoder_opts)) < 0) { - if (ret == AVERROR_EXPERIMENTAL) - abort_codec_experimental(codec, 0); + if ((ret = avcodec_open2(ist->dec_ctx, codec, &ist->decoder_opts)) < 0) { + if (ret == AVERROR_EXPERIMENTAL) + abort_codec_experimental(codec, 0); - av_log(ist, AV_LOG_ERROR, "Error while opening decoder: %s\n", - av_err2str(ret)); - return ret; - } - assert_avoptions(ist->decoder_opts); + av_log(ist, AV_LOG_ERROR, "Error while opening decoder: %s\n", + av_err2str(ret)); + return ret; + } + assert_avoptions(ist->decoder_opts); return 0; }