[vlc-commits] [Git][videolan/vlc][master] 3 commits: gui: ncurses: use size_t for index subscript
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Fri Sep 29 10:54:04 UTC 2023
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
0f47aa08 by Alexandre Janniaux at 2023-09-29T10:30:11+00:00
gui: ncurses: use size_t for index subscript
Fix warning:
../../modules/gui/ncurses.c: In function ‘DrawStats’:
../../modules/gui/ncurses.c:691:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
691 | for (int i = 0; i < item->es_vec.size ; i++) {
| ^
- - - - -
fd14efa7 by Alexandre Janniaux at 2023-09-29T10:30:11+00:00
blend: fix uninitialized alpha
The alpha is not initialized for some chroma which were not using it.
../../modules/video_filter/blend.cpp: In function ‘void Blend(const {anonymous}::CPicture&, const {anonymous}::CPicture&, unsigned int, unsigned int, int) [with TDst = {anonymous}::CPictureYUVPlanar<short unsigned int, 1, 1, false, false>; TSrc = {anonymous}::CPictureRGBX<4>; TConvert = {anonymous}::compose<{anonymous}::convertBits<10, 8>, {anonymous}::convertRgbToYuv8>]’:
../../modules/video_filter/blend.cpp:542:32: warning: ‘spx.{anonymous}::CPixel::a’ may be used uninitialized [-Wmaybe-uninitialized]
542 | unsigned a = div255(alpha * spx.a);
| ~~~~~~^~~~~~~~~~~~~~~
../../modules/video_filter/blend.cpp:537:20: note: ‘spx.{anonymous}::CPixel::a’ was declared here
537 | CPixel spx;
| ^~~
../../modules/video_filter/blend.cpp: In function ‘void Blend(const {anonymous}::CPicture&, const {anonymous}::CPicture&, unsigned int, unsigned int, int) [with TDst = {anonymous}::CPictureYUVPlanar<short unsigned int, 1, 1, false, false>; TSrc = {anonymous}::CPictureRGBX<4>; TConvert = {anonymous}::compose<{anonymous}::convertBits<16, 8>, {anonymous}::convertRgbToYuv8>]’:
../../modules/video_filter/blend.cpp:542:32: warning: ‘spx.{anonymous}::CPixel::a’ may be used uninitialized [-Wmaybe-uninitialized]
542 | unsigned a = div255(alpha * spx.a);
| ~~~~~~^~~~~~~~~~~~~~~
../../modules/video_filter/blend.cpp:537:20: note: ‘spx.{anonymous}::CPixel::a’ was declared here
537 | CPixel spx;
| ^~~
- - - - -
b33eba97 by Alexandre Janniaux at 2023-09-29T10:30:11+00:00
stream_out: rtp: silence unused variable
The es_id string is not used in the RTP module, leading to:
../../modules/stream_out/rtp.c: In function ‘Add’:
../../modules/stream_out/rtp.c:920:83: warning: unused parameter ‘es_id’ [-Wunused-parameter]
920 | static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt, const char * es_id )
| ~~~~~~~~~~~~~^~~~~
- - - - -
3 changed files:
- modules/gui/ncurses.c
- modules/stream_out/rtp.c
- modules/video_filter/blend.cpp
Changes:
=====================================
modules/gui/ncurses.c
=====================================
@@ -688,7 +688,7 @@ static int DrawStats(intf_thread_t *intf)
vlc_mutex_lock(&item->lock);
p_stats = item->p_stats;
- for (int i = 0; i < item->es_vec.size ; i++) {
+ for (size_t i = 0; i < item->es_vec.size ; i++) {
i_audio += (item->es_vec.data[i].es.i_cat == AUDIO_ES);
i_video += (item->es_vec.data[i].es.i_cat == VIDEO_ES);
}
=====================================
modules/stream_out/rtp.c
=====================================
@@ -919,6 +919,7 @@ uint32_t rtp_compute_ts( unsigned i_clock_rate, vlc_tick_t i_pts )
/** Add an ES as a new RTP stream */
static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt, const char * es_id )
{
+ (void)es_id;
/* NOTE: As a special case, if we use a non-RTP
* mux (TS/PS), then p_fmt is NULL. */
sout_stream_sys_t *p_sys = p_stream->p_sys;
=====================================
modules/video_filter/blend.cpp
=====================================
@@ -534,7 +534,7 @@ void Blend(const CPicture &dst_data, const CPicture &src_data,
for (unsigned y = 0; y < height; y++) {
for (unsigned x = 0; x < width; x++) {
- CPixel spx;
+ CPixel spx {};
src.get(&spx, x);
convert(spx);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a235b9dd1b591c89eb555a9de82534227fa0d3a1...b33eba973205409712188bb4109d3dd35f33cf7a
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a235b9dd1b591c89eb555a9de82534227fa0d3a1...b33eba973205409712188bb4109d3dd35f33cf7a
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list