From patchwork Tue Oct 20 11:03:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23113 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 2BA6244A859 for ; Tue, 20 Oct 2020 14:04:15 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 18E6368BA9E; Tue, 20 Oct 2020 14:04:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4AB1568BA8B for ; Tue, 20 Oct 2020 14:04:08 +0300 (EEST) Received: by mail-wm1-f66.google.com with SMTP id q5so1388848wmq.0 for ; Tue, 20 Oct 2020 04:04:08 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=KTmwS0RcxzUGmj6tnDB9wyv91J5Kmyy0+YMw76SE87w=; b=tOC9xetWIoQslnEe94bWnsuecI3w9uXmbqsLgh2ZQtutfYSMi2m7zml4sSrHeFVYiV uiI0ySCO9TvmpOUjXxRO/dpgYDUBaBBnjoUJAWGlCuQMfV+GsaW4ZGR96MPFkZH/Tuwt pZvcUkbh6TgPiOS2ubb0YsgbxGDQ+rJCM/tnfIN8uFIqa4ulzsItjb/GNsyG9ONfCgli pe+DnfH3ixVsT6Exe9qHIQt87PRU30aUwkeVkHwmyTKzLitT0qErvBpEwUoZn99ZytTD EvX4T0RM3LTBnA9nEZ/nN63M8lcn2vAdqdVHXWmHDlfJbuIbqexXqlaNvmU8CtBH3BjX lJxA== 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:mime-version:content-transfer-encoding; bh=KTmwS0RcxzUGmj6tnDB9wyv91J5Kmyy0+YMw76SE87w=; b=WUkZM5T5iS28KkX3kEp4mP4jY61ExAEbtOu8ptjJDpW83p+E+NM6zY5gKzT9MUUHyM /5xeQf3E48GJ7wezhOFLM6FiQiTUzkL7CCGj9GFC8dnIeQddGKvTPK6W+7+sQIPzQyjh 7dKqWA7LevVoXbmOBAbrrrMa+OBBZTP2Y+Sc88+kN05rBfJpcyTzLNsR/Y7w9UPNlgCc BU/z4IeZgGlKtxnWQky5bFmJWfgwMiBDMGv0+Z3vEICKUNLnTb21tDTHufWqBaf5ebBP BqKtndDk/cQX4vUlNGjLmqYf8BqxZ/1T/ep7w2JJkcGkYh0/kRINAy+8KNNKzSOnX87T E6iA== X-Gm-Message-State: AOAM531Mfak5KhGTKi43krccF+Kzbxg+CPYK4G3YaTnDDxM4xKHWCYFR 3j8yBIrin+kyiung4jq+ASgH92g6FXs= X-Google-Smtp-Source: ABdhPJzneoigZnC/JNgHDtx8X/bhmjVz0ubkP5iCffyRJnmuiheg6fOFlmil/b/mTVO4doAq/db8Lg== X-Received: by 2002:a1c:2042:: with SMTP id g63mr2270654wmg.174.1603191847364; Tue, 20 Oct 2020 04:04:07 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id c18sm2413075wrq.5.2020.10.20.04.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Oct 2020 04:04:06 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 20 Oct 2020 13:03:33 +0200 Message-Id: <20201020110334.197116-3-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201020110334.197116-1-andreas.rheinhardt@gmail.com> References: <20201020110334.197116-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/4] avformat/hlsenc: Fix mixed declaration and code 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 --- libavformat/hlsenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 22077073bd..4967247bca 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -352,13 +352,14 @@ static void write_codec_attr(AVStream *st, VariantStream *vs) while (data && (data - st->codecpar->extradata + 19) < st->codecpar->extradata_size) { /* get HEVC SPS NAL and seek to profile_tier_level */ if (!(data[0] | data[1] | data[2]) && data[3] == 1 && ((data[4] & 0x42) == 0x42)) { + uint8_t *rbsp_buf; int remain_size = 0; int rbsp_size = 0; /* skip start code + nalu header */ data += 6; /* process by reference General NAL unit syntax */ remain_size = st->codecpar->extradata_size - (data - st->codecpar->extradata); - uint8_t *rbsp_buf = ff_nal_unit_extract_rbsp(data, remain_size, &rbsp_size, 0); + rbsp_buf = ff_nal_unit_extract_rbsp(data, remain_size, &rbsp_size, 0); if (!rbsp_buf) return; if (rbsp_size < 13) {