From patchwork Thu Feb 25 06:38:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25974 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 1C9C6449E75 for ; Thu, 25 Feb 2021 08:48:54 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E77D5689F3A; Thu, 25 Feb 2021 08:48:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A76BB688321 for ; Thu, 25 Feb 2021 08:48:46 +0200 (EET) IronPort-SDR: 3X0kYiT2pA3aAte9D/QTPtFjPMoOb2EdKKRJ7JY4o3KoA1GxRFFlk/2jiwPRNaYHyoBCp7UE2P cSwk2Dl+/qdA== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="182968973" X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="182968973" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 22:48:44 -0800 IronPort-SDR: tj4ExQBlSTqanlFYHcmWlGrvSdjAPd8iPl3Crb65UmGPLFXrFlgczh4lreIhbyFh2iZKZd6dxL VjN0ZGK1fZMg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="404113261" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga008.jf.intel.com with ESMTP; 24 Feb 2021 22:48:43 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Feb 2021 14:38:10 +0800 Message-Id: <20210225063816.8644-1-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V2 1/7] libavdevice/v4l2.c: fix build warning for [-Wformat-truncation=] 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: yejun.guo@intel.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Here is the warning message: src/libavdevice/v4l2.c: In function ‘v4l2_get_device_list’: src/libavdevice/v4l2.c:1054:58: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 251 [-Wformat-truncation=] snprintf(device_name, sizeof(device_name), "/dev/%s", entry->d_name); ^~ src/libavdevice/v4l2.c:1054:9: note: ‘snprintf’ output between 6 and 261 bytes into a destination of size 256 snprintf(device_name, sizeof(device_name), "/dev/%s", entry->d_name); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Guo, Yejun --- libavdevice/v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 365bacd771..e11d10d20e 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -1046,7 +1046,7 @@ static int v4l2_get_device_list(AVFormatContext *ctx, AVDeviceInfoList *device_l return ret; } while ((entry = readdir(dir))) { - char device_name[256]; + char device_name[512]; if (!v4l2_is_v4l_dev(entry->d_name)) continue; From patchwork Thu Feb 25 06:38:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25975 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 3D921449E75 for ; Thu, 25 Feb 2021 08:48:57 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2219168A0F0; Thu, 25 Feb 2021 08:48:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4E693680A2D for ; Thu, 25 Feb 2021 08:48:48 +0200 (EET) IronPort-SDR: ZxkWDGXfGmXFGP66WaoY9Jn6CinY34QlPMmmYyRFmuixkflH8fp8oSY3N5KdlKNohYm3uTRYvj 3+NwXbuPwkFQ== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="182968977" X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="182968977" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 22:48:45 -0800 IronPort-SDR: dldj5LeG1PNi5v0Pk26mDBOd2AUqJ6NkgwwP4rC3u1QdGFV4sRVLaJpDNq0dV31mF0LlhDZU0Y QPeL9k1msIoA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="404113267" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga008.jf.intel.com with ESMTP; 24 Feb 2021 22:48:44 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Feb 2021 14:38:11 +0800 Message-Id: <20210225063816.8644-2-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210225063816.8644-1-yejun.guo@intel.com> References: <20210225063816.8644-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V2 2/7] libavfilter/vf_ssim.c: fix build warning for [-Wmain] 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: yejun.guo@intel.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The build warning message: src/libavfilter/vf_ssim.c: In function ‘ssim_plane_16bit’: src/libavfilter/vf_ssim.c:246:24: warning: ‘main’ is usually a function [-Wmain] const uint8_t *main = td->main_data[c]; ^~~~ src/libavfilter/vf_ssim.c: In function ‘ssim_plane’: src/libavfilter/vf_ssim.c:289:24: warning: ‘main’ is usually a function [-Wmain] const uint8_t *main = td->main_data[c]; ^~~~ Signed-off-by: Guo, Yejun --- libavfilter/vf_ssim.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c index 9682c093b2..ebb314c69f 100644 --- a/libavfilter/vf_ssim.c +++ b/libavfilter/vf_ssim.c @@ -243,8 +243,8 @@ static int ssim_plane_16bit(AVFilterContext *ctx, void *arg, const int max = td->max; for (int c = 0; c < td->nb_components; c++) { - const uint8_t *main = td->main_data[c]; - const uint8_t *ref = td->ref_data[c]; + const uint8_t *main_data = td->main_data[c]; + const uint8_t *ref_data = td->ref_data[c]; const int main_stride = td->main_linesize[c]; const int ref_stride = td->ref_linesize[c]; int width = td->planewidth[c]; @@ -263,8 +263,8 @@ static int ssim_plane_16bit(AVFilterContext *ctx, void *arg, for (int y = ystart; y < slice_end; y++) { for (; z <= y; z++) { FFSWAP(void*, sum0, sum1); - ssim_4x4xn_16bit(&main[4 * z * main_stride], main_stride, - &ref[4 * z * ref_stride], ref_stride, + ssim_4x4xn_16bit(&main_data[4 * z * main_stride], main_stride, + &ref_data[4 * z * ref_stride], ref_stride, sum0, width); } @@ -286,8 +286,8 @@ static int ssim_plane(AVFilterContext *ctx, void *arg, SSIMDSPContext *dsp = td->dsp; for (int c = 0; c < td->nb_components; c++) { - const uint8_t *main = td->main_data[c]; - const uint8_t *ref = td->ref_data[c]; + const uint8_t *main_data = td->main_data[c]; + const uint8_t *ref_data = td->ref_data[c]; const int main_stride = td->main_linesize[c]; const int ref_stride = td->ref_linesize[c]; int width = td->planewidth[c]; @@ -306,8 +306,8 @@ static int ssim_plane(AVFilterContext *ctx, void *arg, for (int y = ystart; y < slice_end; y++) { for (; z <= y; z++) { FFSWAP(void*, sum0, sum1); - dsp->ssim_4x4_line(&main[4 * z * main_stride], main_stride, - &ref[4 * z * ref_stride], ref_stride, + dsp->ssim_4x4_line(&main_data[4 * z * main_stride], main_stride, + &ref_data[4 * z * ref_stride], ref_stride, sum0, width); } From patchwork Thu Feb 25 06:38:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25976 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 25B52449E75 for ; Thu, 25 Feb 2021 08:48:58 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0BB7868A1E4; Thu, 25 Feb 2021 08:48:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 59025689C5C for ; Thu, 25 Feb 2021 08:48:50 +0200 (EET) IronPort-SDR: FSS9wKotMjwv/l09kZ6Ls9vxsIl6NhdEQLOOzxML0EY/lEw+5AEY8tM+c1i6l+QkKiWODb7O5k 5/E7rb+4niIA== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="182968988" X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="182968988" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 22:48:47 -0800 IronPort-SDR: 8FXdv7PatCsKJmajr5/MXi5vgUrgNTdFotORqrSpfNuNWRH3nPsYqCOfuNHtJ4rMnRVkbms5Sj 1Ip6vF2Baprw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="404113285" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga008.jf.intel.com with ESMTP; 24 Feb 2021 22:48:46 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Feb 2021 14:38:12 +0800 Message-Id: <20210225063816.8644-3-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210225063816.8644-1-yejun.guo@intel.com> References: <20210225063816.8644-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V2 3/7] libavfilter/vf_vif.c: fix build warning for [-Wmain] 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: yejun.guo@intel.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" src/libavfilter/vf_vif.c: In function ‘process_frame’: src/libavfilter/vf_vif.c:542:20: warning: ‘main’ is usually a function [-Wmain] AVFrame *out, *main = NULL, *ref = NULL; ^~~~ Signed-off-by: Guo, Yejun --- libavfilter/vf_vif.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_vif.c b/libavfilter/vf_vif.c index 876c7c9120..0bd71eca5c 100644 --- a/libavfilter/vf_vif.c +++ b/libavfilter/vf_vif.c @@ -539,22 +539,22 @@ static int process_frame(FFFrameSync *fs) AVFilterContext *ctx = fs->parent; VIFContext *s = fs->opaque; AVFilterLink *outlink = ctx->outputs[0]; - AVFrame *out, *main = NULL, *ref = NULL; + AVFrame *out_frame, *main_frame = NULL, *ref_frame = NULL; int ret; - ret = ff_framesync_dualinput_get(fs, &main, &ref); + ret = ff_framesync_dualinput_get(fs, &main_frame, &ref_frame); if (ret < 0) return ret; - if (ctx->is_disabled || !ref) { - out = main; + if (ctx->is_disabled || !ref_frame) { + out_frame = main_frame; } else { - out = do_vif(ctx, main, ref); + out_frame = do_vif(ctx, main_frame, ref_frame); } - out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base); + out_frame->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base); - return ff_filter_frame(outlink, out); + return ff_filter_frame(outlink, out_frame); } From patchwork Thu Feb 25 06:38:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25977 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 20310449E75 for ; Thu, 25 Feb 2021 08:49:00 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0498768A27A; Thu, 25 Feb 2021 08:49:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CFD5B68A199 for ; Thu, 25 Feb 2021 08:48:52 +0200 (EET) IronPort-SDR: t/jRzYcjgVlpXBoLkXFjNIP70Hn6RWqN6WG6Dnwnglcy2rJM1NVVuRpvWMZEKYWQJlhFzPrvFV KER8IEAtPGkw== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="182968990" X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="182968990" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 22:48:48 -0800 IronPort-SDR: 194NJkTUl8m3FSQ4eQenpzQLwoUH3zKmzNYqeQJGB3ck+UDDUnmEs8n8cCTZAn5ndKdWj5Eu+f dHsIlB8lxm3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="404113297" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga008.jf.intel.com with ESMTP; 24 Feb 2021 22:48:47 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Feb 2021 14:38:13 +0800 Message-Id: <20210225063816.8644-4-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210225063816.8644-1-yejun.guo@intel.com> References: <20210225063816.8644-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V2 4/7] libavformat/dashenc.c: fix build warning for [-Wformat-truncation=] 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: yejun.guo@intel.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Part of warning message: src/libavformat/dashenc.c: In function ‘flush_init_segment’: src/libavformat/dashenc.c:608:49: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size between 1 and 1024 [-Wformat-truncation=] snprintf(filename, sizeof(filename), "%s%s", c->dirname, os->initfile); ^~ src/libavformat/dashenc.c:608:9: note: ‘snprintf’ output between 1 and 2047 bytes into a destination of size 1024 snprintf(filename, sizeof(filename), "%s%s", c->dirname, os->initfile); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Guo, Yejun --- libavformat/dashenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 2d757b3a87..b11f79c966 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -126,7 +126,7 @@ typedef struct OutputStream { char codec_str[100]; int written_len; char filename[1024]; - char full_path[1024]; + char full_path[2048]; char temp_path[1024]; double availability_time_offset; AVProducerReferenceTime producer_reference_time; @@ -604,7 +604,7 @@ static int flush_init_segment(AVFormatContext *s, OutputStream *os) os->pos = os->init_range_length = range_length; if (!c->single_file) { - char filename[1024]; + char filename[2048]; snprintf(filename, sizeof(filename), "%s%s", c->dirname, os->initfile); dashenc_io_close(s, &os->out, filename); } @@ -1480,7 +1480,7 @@ static int dash_init(AVFormatContext *s) AVFormatContext *ctx; AVStream *st; AVDictionary *opts = NULL; - char filename[1024]; + char filename[2048]; os->bit_rate = s->streams[i]->codecpar->bit_rate; if (!os->bit_rate) { From patchwork Thu Feb 25 06:38:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25982 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 52994449E75 for ; Thu, 25 Feb 2021 08:49:04 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3771068A328; Thu, 25 Feb 2021 08:49:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 340EE689E56 for ; Thu, 25 Feb 2021 08:48:54 +0200 (EET) IronPort-SDR: P/b7off3lINxGLTx8LLPW/XlTwHvRhWPRZKo3w9P4Exb4EdB7AMUGKb9RcQ6+HUcdeyDN4yWwS AixJ0qaHhGhg== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="182968993" X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="182968993" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 22:48:49 -0800 IronPort-SDR: cy840xAB/tP75OMyaSby0bnutW8GcAU7F2a2a9Y6/37DUhPhrLTSdQuqVaGB1v4rUBIwYfbEcF VzX6VQ2xYi9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="404113302" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga008.jf.intel.com with ESMTP; 24 Feb 2021 22:48:48 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Feb 2021 14:38:14 +0800 Message-Id: <20210225063816.8644-5-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210225063816.8644-1-yejun.guo@intel.com> References: <20210225063816.8644-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V2 5/7] libavformat/protocols.c: fix build warning for [-Wdiscarded-qualifiers] 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: yejun.guo@intel.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" src/libavformat/protocols.c: In function ‘avio_enum_protocols’: src/libavformat/protocols.c:116:7: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] p = p ? p + 1 : url_protocols; ^ Signed-off-by: Guo, Yejun --- libavformat/protocols.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/protocols.c b/libavformat/protocols.c index 7df18fbb3b..86cde84a31 100644 --- a/libavformat/protocols.c +++ b/libavformat/protocols.c @@ -113,7 +113,7 @@ const char *avio_enum_protocols(void **opaque, int output) { const URLProtocol **p = *opaque; - p = p ? p + 1 : url_protocols; + p = p ? p + 1 : (const URLProtocol **)url_protocols; *opaque = p; if (!*p) { *opaque = NULL; From patchwork Thu Feb 25 06:38:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25983 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 16BFB449E75 for ; Thu, 25 Feb 2021 08:49:05 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EE73A68A32C; Thu, 25 Feb 2021 08:49:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 513E8689F8E for ; Thu, 25 Feb 2021 08:48:56 +0200 (EET) IronPort-SDR: 9PMOzID2omVGMhRnEsGRreHvOJ9ZoGv4XVvJOFypSbwRVAThKxD0RmId8iL8nAr3FkXc5A6Eg0 pc+tZGAakCUw== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="182968995" X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="182968995" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 22:48:50 -0800 IronPort-SDR: ObTcwww2FSaAJN99KMSdaWkzMjpnDeD4Zeh7Axw9YQUYw8Js5uqgCgN4sYhQZbVJrGKnozhE9K 69WdmWCmCJbQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="404113313" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga008.jf.intel.com with ESMTP; 24 Feb 2021 22:48:49 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Feb 2021 14:38:15 +0800 Message-Id: <20210225063816.8644-6-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210225063816.8644-1-yejun.guo@intel.com> References: <20210225063816.8644-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V2 6/7] libavformat/smoothstreamingenc.c: fix build warning for [-Wformat-truncation=] 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: yejun.guo@intel.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Part of the build message: src/libavformat/smoothstreamingenc.c: In function ‘ism_flush’: src/libavformat/smoothstreamingenc.c:510:49: warning: ‘/temp’ directive output may be truncated writing 5 bytes into a region of size between 1 and 1024 [-Wformat-truncation=] snprintf(filename, sizeof(filename), "%s/temp", os->dirname); ^~~~~ src/libavformat/smoothstreamingenc.c:510:9: note: ‘snprintf’ output between 6 and 1029 bytes into a destination of size 1024 snprintf(filename, sizeof(filename), "%s/temp", os->dirname); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/libavformat/smoothstreamingenc.c:538:53: warning: ‘/temp’ directive output may be truncated writing 5 bytes into a region of size between 1 and 1024 [-Wformat-truncation=] snprintf(filename, sizeof(filename), "%s/temp", os->dirname); ^~~~~ src/libavformat/smoothstreamingenc.c:538:13: note: ‘snprintf’ output between 6 and 1029 bytes into a destination of size 1024 snprintf(filename, sizeof(filename), "%s/temp", os->dirname); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/libavformat/smoothstreamingenc.c:545:63: warning: ‘/FragmentInfo(’ directive output may be truncated writing 14 bytes into a region of size between 1 and 1024 [-Wformat-truncation=] snprintf(header_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts); ^~~~~~~~~~~~~~ src/libavformat/smoothstreamingenc.c:545:60: note: using the range [0, 18446744073709551615] for directive argument snprintf(header_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts); ^~~~~~~~~~~~~~~~~~~~~~ src/libavformat/smoothstreamingenc.c:545:9: note: ‘snprintf’ output 18 or more bytes (assuming 1041) into a destination of size 1024 snprintf(header_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Guo, Yejun --- libavformat/smoothstreamingenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c index ba5cc27ca0..5a9a5dddf0 100644 --- a/libavformat/smoothstreamingenc.c +++ b/libavformat/smoothstreamingenc.c @@ -501,7 +501,7 @@ static int ism_flush(AVFormatContext *s, int final) for (i = 0; i < s->nb_streams; i++) { OutputStream *os = &c->streams[i]; - char filename[1024], target_filename[1024], header_filename[1024], curr_dirname[1024]; + char filename[2048], target_filename[2048], header_filename[2048], curr_dirname[1024]; int64_t size; int64_t start_ts, duration, moof_size; if (!os->packets_written) From patchwork Thu Feb 25 06:38:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25981 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 3C5E9449E75 for ; Thu, 25 Feb 2021 08:49:03 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 248CA68A326; Thu, 25 Feb 2021 08:49:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BE8BE68A27A for ; Thu, 25 Feb 2021 08:48:58 +0200 (EET) IronPort-SDR: sYbKALSB5qQ+OmNOEEePBSv/cILz16kSEbJkIeLJnQtBzra2it4vQGwn1dKkYHTLycmiPuZ09R E5m299JETXgw== X-IronPort-AV: E=McAfee;i="6000,8403,9905"; a="182969001" X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="182969001" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 22:48:53 -0800 IronPort-SDR: DOKu/iMb7qt6wuuU86GgnQXoLlN7es+p1JpQSO27P/ZSoCzHBKY/ryk/WA5Fuk2sdwQI1b6yOj 11BOw1R0e9Kg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,205,1610438400"; d="scan'208";a="404113329" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga008.jf.intel.com with ESMTP; 24 Feb 2021 22:48:50 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Thu, 25 Feb 2021 14:38:16 +0800 Message-Id: <20210225063816.8644-7-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210225063816.8644-1-yejun.guo@intel.com> References: <20210225063816.8644-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH V2 7/7] libavutil/opt.c: fix build warning for [-Wdiscarded-qualifiers] 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: yejun.guo@intel.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" src/libavutil/opt.c: In function ‘av_opt_child_class_iterate’: src/libavutil/opt.c:1738:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] *iter = parent->child_class_next(*iter); ^ Signed-off-by: Guo, Yejun --- libavutil/opt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index 590146b5fb..c47146c47f 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1735,7 +1735,7 @@ const AVClass *av_opt_child_class_iterate(const AVClass *parent, void **iter) #if FF_API_CHILD_CLASS_NEXT FF_DISABLE_DEPRECATION_WARNINGS if (parent->child_class_next) { - *iter = parent->child_class_next(*iter); + *iter = (void *)parent->child_class_next(*iter); return *iter; } FF_ENABLE_DEPRECATION_WARNINGS