From patchwork Sat Feb 20 07:22: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: 25829 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 9F1C44498CA for ; Sat, 20 Feb 2021 09:32:47 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 68DB268A5A8; Sat, 20 Feb 2021 09:32:47 +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 9225768807B for ; Sat, 20 Feb 2021 09:32:40 +0200 (EET) IronPort-SDR: gxNrEXmqMfWnqowC1x4ikBb+jGLJixWcGSLO41mtV4+yipKJj9j1kZmGrGzZzYqPNUhdI3dxiG sGIPWiEWCclA== X-IronPort-AV: E=McAfee;i="6000,8403,9900"; a="181506569" X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="181506569" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2021 23:32:38 -0800 IronPort-SDR: mgdFW+FF8U7L8TZxfTKo9Cuo/fd5Og6FWIdIaj7hc9cxiogLrtiaVfjquA2SKWkeZVA62BfeZt KvbFl/HbaWAQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="440578041" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga001.jf.intel.com with ESMTP; 19 Feb 2021 23:32:37 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Feb 2021 15:22:11 +0800 Message-Id: <20210220072218.31629-1-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/8] libavdevice/v4l2.c: fix build warning 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); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- This patch set fixes build warnings during make on my system with gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) with config option: --disable-optimizations --enable-libx264 --enable-libx265 --enable-gpl --enable-libvpx --enable-libmfx --extra-cflags="-Wno-deprecated-declarations" I also tried '-Wall -Werror', there are many many issues starting from configure. It is a long term task, let's fix one by one when have time. libavdevice/v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 365bacd771..15ade26eed 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[261]; if (!v4l2_is_v4l_dev(entry->d_name)) continue; From patchwork Sat Feb 20 07:22: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: 25830 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 B1E3A4498CA for ; Sat, 20 Feb 2021 09:32:49 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9262C68A711; Sat, 20 Feb 2021 09:32:49 +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 7001568A636 for ; Sat, 20 Feb 2021 09:32:42 +0200 (EET) IronPort-SDR: m8UzNGyEk8YJCz4lToVwhpDEXD9O/FaQ5m9ADKMI+Lp5QCMpw3jbPNaXRVZ6fN+tjzy3t3PDkN IymEZOspXn/Q== X-IronPort-AV: E=McAfee;i="6000,8403,9900"; a="181506580" X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="181506580" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2021 23:32:39 -0800 IronPort-SDR: brMkJKZghtanGvBjujlmGqPmFiRyNJyQTuFm7hud7rndkgMuPnYi3+wWwVpvHAw0mWAK17K/Mp lE4n0oR2RjPQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="440578046" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga001.jf.intel.com with ESMTP; 19 Feb 2021 23:32:38 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Feb 2021 15:22:12 +0800 Message-Id: <20210220072218.31629-2-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210220072218.31629-1-yejun.guo@intel.com> References: <20210220072218.31629-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/8] libavfilter/vf_ssim.c: fix build warning 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]; ^~~~ --- 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 Sat Feb 20 07:22: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: 25831 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 A0EC34498CA for ; Sat, 20 Feb 2021 09:32:52 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8A2CB68A7E9; Sat, 20 Feb 2021 09:32:52 +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 7FA3968A711 for ; Sat, 20 Feb 2021 09:32:43 +0200 (EET) IronPort-SDR: nNIyDPAFw2Ete6GyjWnj59qN7NPeofSQ85B0DbAJDIi8LqLALwhg3swIEzs8qOAkgChFL15QJd JJSFKf0PXuhA== X-IronPort-AV: E=McAfee;i="6000,8403,9900"; a="181506597" X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="181506597" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2021 23:32:40 -0800 IronPort-SDR: or10JfIVdHvXUqBiuFlwJNdKENA3BH6HU2QtTl/qpZuT92/T4PEYj2dLElUmAJcpDuPoDrxfY9 1D35O3NBcEgw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="440578053" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga001.jf.intel.com with ESMTP; 19 Feb 2021 23:32:39 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Feb 2021 15:22:13 +0800 Message-Id: <20210220072218.31629-3-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210220072218.31629-1-yejun.guo@intel.com> References: <20210220072218.31629-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/8] libavfilter/vf_vif.c: fix build warning 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; ^~~~ --- 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 Sat Feb 20 07:22: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: 25832 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 CBFC14498CA for ; Sat, 20 Feb 2021 09:32:53 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9AC9D68A82B; Sat, 20 Feb 2021 09:32: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 80E2F68A3BF for ; Sat, 20 Feb 2021 09:32:46 +0200 (EET) IronPort-SDR: EPblsK/ffKVxP79xrkUD+TYsRWyYokn5TgRnP2qBQaxZiNtI5fO1PjNBdalSUT1+HG4dSVxR02 I9leatrbVmCA== X-IronPort-AV: E=McAfee;i="6000,8403,9900"; a="181506607" X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="181506607" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2021 23:32:41 -0800 IronPort-SDR: cUOZ9m2UFRDpsNgrbeTV41lokgbXETt/HU2UczLvKShVl9ZtibHtxl1DYMQW7/2uIU7w8/Exv+ RxSbKplLjT5A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="440578059" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga001.jf.intel.com with ESMTP; 19 Feb 2021 23:32:40 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Feb 2021 15:22:14 +0800 Message-Id: <20210220072218.31629-4-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210220072218.31629-1-yejun.guo@intel.com> References: <20210220072218.31629-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/8] libavformat/dashenc.c: fix build warning 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); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- 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 Sat Feb 20 07:22: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: 25833 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 E954D4498CA for ; Sat, 20 Feb 2021 09:32:54 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D443568A7FD; Sat, 20 Feb 2021 09:32:54 +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 7F78C68A82A for ; Sat, 20 Feb 2021 09:32:48 +0200 (EET) IronPort-SDR: kNsiEpBz4B7OpPLrMddRPu9WPyOuEabOGztabIEd0Kpfq63twMfAqBIkJXMZsKSdU/Gvt76g0j yYR6xoWKqSUA== X-IronPort-AV: E=McAfee;i="6000,8403,9900"; a="181506614" X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="181506614" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2021 23:32:43 -0800 IronPort-SDR: hIzS4f3Am7c8Q5runvUif+yqn/jAzVgVyDjFXH+n/pi2HHuOKF1TKPbkNcsakiRul1gmUtGuyz WDGISr4CVUyA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="440578064" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga001.jf.intel.com with ESMTP; 19 Feb 2021 23:32:42 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Feb 2021 15:22:15 +0800 Message-Id: <20210220072218.31629-5-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210220072218.31629-1-yejun.guo@intel.com> References: <20210220072218.31629-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/8] libavformat/protocols.c: fix build warning 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; ^ --- 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 Sat Feb 20 07:22: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: 25834 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 EFA394498CA for ; Sat, 20 Feb 2021 09:32:57 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D1B1A68A83C; Sat, 20 Feb 2021 09:32: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 713B468A82A for ; Sat, 20 Feb 2021 09:32:49 +0200 (EET) IronPort-SDR: bSBaLyEjDyGm7gV2d+hq47qTWUGDNUmba1d12UJOGZuWeORorSbMm3UGeyr2PAr8KxZwiu3NQl stL8h9EYmt3w== X-IronPort-AV: E=McAfee;i="6000,8403,9900"; a="181506621" X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="181506621" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2021 23:32:44 -0800 IronPort-SDR: NSW0bedrcA1Di3n7j/hQqSPwhhOIlH0rSsT9AaHEx21g1rqTcY7n6eUGU1xsGEw2GPYuNsEivD iAU4y2tA6nGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="440578072" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga001.jf.intel.com with ESMTP; 19 Feb 2021 23:32:43 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Feb 2021 15:22:16 +0800 Message-Id: <20210220072218.31629-6-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210220072218.31629-1-yejun.guo@intel.com> References: <20210220072218.31629-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/8] libavformat/smoothstreamingenc.c: fix build warning 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); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- libavformat/smoothstreamingenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c index ba5cc27ca0..397028973d 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[1029], target_filename[1041], header_filename[1041], curr_dirname[1024]; int64_t size; int64_t start_ts, duration, moof_size; if (!os->packets_written) From patchwork Sat Feb 20 07:22:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25835 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 0AA9C4498CA for ; Sat, 20 Feb 2021 09:32:59 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E28B068A880; Sat, 20 Feb 2021 09:32: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 7068E68A87F for ; Sat, 20 Feb 2021 09:32:52 +0200 (EET) IronPort-SDR: 5ZvJTiFWWI7n44vafJN6c39gHOWfoHxxdLIV5NjYX9vTnS6kUO11ctCt51Ff01+daH0cuWzd62 6Opl4xph0yqQ== X-IronPort-AV: E=McAfee;i="6000,8403,9900"; a="181506640" X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="181506640" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2021 23:32:46 -0800 IronPort-SDR: pElYEtT9OqEbQKOgaY7uTOE2W7+p9CU98rCTjsSKkJ8e5wU/P4x+xD9q74FxPupjeyz/+Nf0Hk FZb7426Q9Mrw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="440578090" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga001.jf.intel.com with ESMTP; 19 Feb 2021 23:32:44 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Feb 2021 15:22:17 +0800 Message-Id: <20210220072218.31629-7-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210220072218.31629-1-yejun.guo@intel.com> References: <20210220072218.31629-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 7/8] libavcodec/movtextenc.c: fix build warning 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/libavcodec/movtextenc.c: In function ‘mov_text_style_start’: src/libavcodec/movtextenc.c:358:26: warning: comparison is always false due to limited range of data type [-Wtype-limits] if (s->count + 1 > SIZE_MAX / sizeof(*s->style_attributes) || ^ --- libavcodec/movtextenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 1bef21e0b9..378d8ae3f9 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -355,7 +355,7 @@ static int mov_text_style_start(MovTextContext *s) StyleBox *tmp; // last style != defaults, end the style entry and start a new one - if (s->count + 1 > SIZE_MAX / sizeof(*s->style_attributes) || + if (s->count + 1 > UINT_MAX / sizeof(*s->style_attributes) || !(tmp = av_fast_realloc(s->style_attributes, &s->style_attributes_bytes_allocated, (s->count + 1) * sizeof(*s->style_attributes)))) { From patchwork Sat Feb 20 07:22:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 25836 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 40ACD4498CA for ; Sat, 20 Feb 2021 09:33:01 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2586968A898; Sat, 20 Feb 2021 09:33:01 +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 67DCB68A8B9 for ; Sat, 20 Feb 2021 09:32:54 +0200 (EET) IronPort-SDR: xOtuTt7KQ8Eed52D2qAothfm4pd9IWUKbuIY3pwA4XcFqj1KhOgKAsmdnm+bGm+sErZcx3ijuE yJ+otzFe+1/Q== X-IronPort-AV: E=McAfee;i="6000,8403,9900"; a="181506647" X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="181506647" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2021 23:32:47 -0800 IronPort-SDR: XnikdVLpDkLbdLhe7+54SdEZ02b6w1D1W4vdm1LyRlD5raYS1pw7ZbBYd/GzvmBi936QHVj9Cw h4uDlbeR8ZRQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,192,1610438400"; d="scan'208";a="440578098" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.159.53]) by orsmga001.jf.intel.com with ESMTP; 19 Feb 2021 23:32:46 -0800 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Feb 2021 15:22:18 +0800 Message-Id: <20210220072218.31629-8-yejun.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210220072218.31629-1-yejun.guo@intel.com> References: <20210220072218.31629-1-yejun.guo@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 8/8] libavutil/opt.c: fix build warning 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); ^ --- This patch set fixes build warnings during make on my system with gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) with config option: --disable-optimizations --enable-libx264 --enable-libx265 --enable-gpl --enable-libvpx --enable-libmfx --extra-cflags="-Wno-deprecated-declarations" I also tried '-Wall -Werror', there are many many issues starting from configure. It is a long term task, let's fix one by one when have time. 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