From patchwork Thu Mar 4 15:42:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 26094 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 76735449EC7 for ; Thu, 4 Mar 2021 17:43:18 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5DA5468AB96; Thu, 4 Mar 2021 17:43:18 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D448A68AB1E for ; Thu, 4 Mar 2021 17:43:09 +0200 (EET) Received: by mail-ej1-f42.google.com with SMTP id ci14so31215950ejc.7 for ; Thu, 04 Mar 2021 07:43:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=/VbDG3QofzXCB98AasbKaeVlhFzEqCra/4N7gNtKDfQ=; b=p+hq0y9MKqdbT4DXUU0/gTz7u29GfTuIXSYz5SvshsgMcouRnHCTLklr9VKPJ5ZCJn e9kT8Cg4JCTDye3rYTFPyCVaRDqnkLtqH5AdUMdpYMvAOXG0NRgGfErk5lvKnC4IJ7i+ SWWFw+fG3mP7HLT62+PDQdw1nWeE5X259lRbFHLLYvOX0ffKrJi2JVvIWpoy/+EjMbgL NZlUwG2/YK2FtcyEhlfNlrtEFhelEjNjucQierzMsprNiRknWGa8qxoYupBJXYMZl81N +LyTmdPM+9cCcMjZsrTriYJxRypofqbaYah1UOBaQWM3Ap+Td+GzQVA70hJis3UkIQT0 xBcg== 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:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=/VbDG3QofzXCB98AasbKaeVlhFzEqCra/4N7gNtKDfQ=; b=Q42RHcrOz7LttZRAKJyd+DMiY55xz8XU0CO1B/90/7scBdcBk+NuIf/GKc4WKYTveO FcUQDDgie1gPf7cBmcfAQbJdj/44EFeO20Vj421yPXjwy3hZqOvpm7HH5oMtRxKf8ieU EGfS4HP3eW2nPXDrSbIo1u1mxB8/jxe4Tcb/Xd2h0F7axhAZTp37HsRxx9m/QhZKAZLl /WBbnuS4a7PQo0MTnBIhX4DADqz93tNfSp1wNI73Bpa9fLtLlIsCBLbRvBTeIrwIZPaB GEuYn850BNxJMxLwrI47zAo7NQUbhmSEqk4ttEgWZB+43ysfquscgRqKZrcOtG7qwfAy NLwQ== X-Gm-Message-State: AOAM533oYKk37E5wGYLHb+qFD+H3qA9O1W3obAj6ryURlR932oV9NkQY wynNYb3r0C0CCjnnLZ4S3p/rYuP29sQ= X-Google-Smtp-Source: ABdhPJy8GN8u1Spsn79aKj1odUi7/FppejGVNHGmM9zgkomhyKtLSH+R7Vm/9H5z2tle0GFf/rgUeQ== X-Received: by 2002:a17:906:16ca:: with SMTP id t10mr4930930ejd.85.1614872589070; Thu, 04 Mar 2021 07:43:09 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id y24sm22673391eds.23.2021.03.04.07.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 07:43:08 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Mar 2021 16:42:32 +0100 Message-Id: <20210304154233.934640-7-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210304154233.934640-1-andreas.rheinhardt@gmail.com> References: <20210304154233.934640-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 7/8] avcodec/decode: Reindent after previous commits 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 --- libavcodec/decode.c | 68 ++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 04cb050dc7..db0030bfd6 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -1050,47 +1050,47 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, if (ret < 0) return ret; - if (avctx->pkt_timebase.num && avpkt->pts != AV_NOPTS_VALUE) - sub->pts = av_rescale_q(avpkt->pts, - avctx->pkt_timebase, AV_TIME_BASE_Q); + if (avctx->pkt_timebase.num && avpkt->pts != AV_NOPTS_VALUE) + sub->pts = av_rescale_q(avpkt->pts, + avctx->pkt_timebase, AV_TIME_BASE_Q); ret = avctx->codec->decode(avctx, sub, got_sub_ptr, (AVPacket*)pkt); - av_assert1((ret >= 0) >= !!*got_sub_ptr && - !!*got_sub_ptr >= !!sub->num_rects); + av_assert1((ret >= 0) >= !!*got_sub_ptr && + !!*got_sub_ptr >= !!sub->num_rects); #if FF_API_ASS_TIMING - if (avctx->sub_text_format == FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS - && *got_sub_ptr && sub->num_rects) { - const AVRational tb = avctx->pkt_timebase.num ? avctx->pkt_timebase - : avctx->time_base; - int err = convert_sub_to_old_ass_form(sub, avpkt, tb); - if (err < 0) - ret = err; - } + if (avctx->sub_text_format == FF_SUB_TEXT_FMT_ASS_WITH_TIMINGS + && *got_sub_ptr && sub->num_rects) { + const AVRational tb = avctx->pkt_timebase.num ? avctx->pkt_timebase + : avctx->time_base; + int err = convert_sub_to_old_ass_form(sub, avpkt, tb); + if (err < 0) + ret = err; + } #endif - if (sub->num_rects && !sub->end_display_time && avpkt->duration && - avctx->pkt_timebase.num) { - AVRational ms = { 1, 1000 }; - sub->end_display_time = av_rescale_q(avpkt->duration, - avctx->pkt_timebase, ms); - } + if (sub->num_rects && !sub->end_display_time && avpkt->duration && + avctx->pkt_timebase.num) { + AVRational ms = { 1, 1000 }; + sub->end_display_time = av_rescale_q(avpkt->duration, + avctx->pkt_timebase, ms); + } - if (avctx->codec_descriptor->props & AV_CODEC_PROP_BITMAP_SUB) - sub->format = 0; - else if (avctx->codec_descriptor->props & AV_CODEC_PROP_TEXT_SUB) - sub->format = 1; - - for (i = 0; i < sub->num_rects; i++) { - if (avctx->sub_charenc_mode != FF_SUB_CHARENC_MODE_IGNORE && - sub->rects[i]->ass && !utf8_check(sub->rects[i]->ass)) { - av_log(avctx, AV_LOG_ERROR, - "Invalid UTF-8 in decoded subtitles text; " - "maybe missing -sub_charenc option\n"); - avsubtitle_free(sub); - ret = AVERROR_INVALIDDATA; - break; - } + if (avctx->codec_descriptor->props & AV_CODEC_PROP_BITMAP_SUB) + sub->format = 0; + else if (avctx->codec_descriptor->props & AV_CODEC_PROP_TEXT_SUB) + sub->format = 1; + + for (i = 0; i < sub->num_rects; i++) { + if (avctx->sub_charenc_mode != FF_SUB_CHARENC_MODE_IGNORE && + sub->rects[i]->ass && !utf8_check(sub->rects[i]->ass)) { + av_log(avctx, AV_LOG_ERROR, + "Invalid UTF-8 in decoded subtitles text; " + "maybe missing -sub_charenc option\n"); + avsubtitle_free(sub); + ret = AVERROR_INVALIDDATA; + break; } + } if (*got_sub_ptr) avctx->frame_number++;