[MPlayer-dev-eng] Unbreak build

Alexander Strasser eclipse7 at gmx.net
Fri Sep 20 23:52:35 EEST 2024


Hi Nicolas!

On 2024-09-20 09:28 +0200, Nicolas George wrote:
> I should pull my weight around here.
>
> The attached patch series fixes build with recent ffmpeg and Debian
> testing:
>
> - ffmpeg requires a few changes in the configure script;

Thanks just did the same here locally.
Fixes are identical to mine and look fine to apply.

> - gcc 14 has started considering incompatible implicit pointer casts as
>   fatal errors;

I have sent a similar big patch before on this list also linked from
this ticket: https://trac.mplayerhq.hu/ticket/2424

You could compare a little against my version and apply yours. Mine
has too many changes because I accidentally also worked on instances
that were still only warnings in GCC-14.

Actually I think that many of the changes are not really for the
better, but the problem is within FFmpeg APIs for most of them.

Distros are switching to GCC 14. So please apply.


> - the fast-math change was reported by multiple persons.

Also LGTM.

There is also this ticket: https://trac.mplayerhq.hu/ticket/2425

I also considered using -fno-math-errno and -fno-trapping-math instead.
But after reading GCC BUG 88576
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88576) I feel like  maybe
better not to and just play it safe.


Thanks for your work on this! Feel free to go ahead and commit to SVN.


Best regards,
  Alexander


> I have only tested building most changes, not running, I think it is
> enough to apply.
>
> Regards,
>
> --
>   Nicolas George

> From 07730f6a4e3cf003285deacdb740f24c30108295 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 00:51:54 +0200
> Subject: [PATCH 01/22] configure: disable Vulkan encoders
>
> They require headers, build fails without.
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 0ee18358b..1e680da79 100755
> --- a/configure
> +++ b/configure
> @@ -1652,7 +1652,7 @@ libavprotocols=$(echo $libavprotocols_all)
>  libavfilters=$(echo $libavfilters_all)
>
>  libavdecoders=$(filter_out_component decoder 'LIB[A-Z0-9_]* [A-Z0-9]*_QSV [A-Z0-9]*_MMAL [A-Z0-9]*_MEDIACODEC [A-Z0-9]*_CUVID [A-Z0-9_]*_AT [A-Z0-9]*_RKMPP [A-Z0-9]*_V4L2M2M')
> -libavencoders=$(filter_out_component encoder 'LIB[A-Z0-9_]* [A-Z0-9]*_QSV [A-Z0-9]*_MMAL [A-Z0-9]*_MEDIACODEC NVENC[A-Z0-9_]* AV1_NVENC[A-Z0-9_]* H264_NVENC[A-Z0-9_]* HEVC_NVENC[A-Z0-9_]* HAP [A-Z0-9]*_VIDEOTOOLBOX [A-Z0-9]*_VAAPI [A-Z0-9]*_OMX [A-Z0-9_]*_AT [A-Z0-9]*_V4L2M2M [A-Z0-9]*_AMF [A-Z0-9]*_MF' [A-Z0-9_]*D3D12VA[A-Z0-9_]*)
> +libavencoders=$(filter_out_component encoder 'LIB[A-Z0-9_]* [A-Z0-9]*_QSV [A-Z0-9]*_MMAL [A-Z0-9]*_MEDIACODEC NVENC[A-Z0-9_]* AV1_NVENC[A-Z0-9_]* H264_NVENC[A-Z0-9_]* HEVC_NVENC[A-Z0-9_]* HAP [A-Z0-9]*_VIDEOTOOLBOX [A-Z0-9]*_VAAPI [A-Z0-9]*_OMX [A-Z0-9_]*_AT [A-Z0-9]*_V4L2M2M [A-Z0-9]*_AMF [A-Z0-9]*_MF [A-Z0-9_]*D3D12VA[A-Z0-9_]* [A-Z0-9]*_VULKAN')
>  libavbsfs=$(filter_out_component bsf 'TRACE_HEADERS [A-Z0-9_]*_METADATA H264_REDUNDANT_PPS FILTER_UNITS')
>  libavdemuxers=$(filter_out_component demuxer 'AVISYNTH LIB[A-Z0-9_]* REDIR VAPOURSYNTH')
>  libavmuxers=$(filter_out_component muxer 'CHROMAPRINT LIB[A-Z0-9_]* RTP RTSP SAP')
> --
> 2.45.2
>

> From af9ab2f4e0f7f4f0e7fd4bc555a97b7b11e6888b Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 00:52:46 +0200
> Subject: [PATCH 02/22] configure: remove -ffast-math
>
> Nowadays most speed-critical code has asm optimizations.
>
> Fix a strange delay with lavf files.
> ---
>  configure | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 1e680da79..d1913c814 100755
> --- a/configure
> +++ b/configure
> @@ -2969,10 +2969,9 @@ if test -z "$CFLAGS" || test "$_profile" != "" || test "$_debug" != ""; then
>    elif test "$cc_vendor" != "gnu" ; then
>      CFLAGS="-O2 $_march $_mcpu $_pipe"
>    else
> -    CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
> +    CFLAGS="-O4 $_march $_mcpu $_pipe -fomit-frame-pointer"
>      WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Werror=format-security"
>      WARN_CFLAGS="-Werror-implicit-function-declaration"
> -    extra_ldflags="$extra_ldflags -ffast-math"
>    fi
>
>    if test "$_profile" != "" || test "$_debug" != ""; then
> --
> 2.45.2
>

> From e3134929462be65bdd068dc54fbcea6e60fc3270 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 00:53:44 +0200
> Subject: [PATCH 03/22] configure: enable DOVI encoder
>
> Fix build.
> ---
>  configure | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/configure b/configure
> index d1913c814..be39cbc3c 100755
> --- a/configure
> +++ b/configure
> @@ -8924,6 +8924,7 @@ CONFIG_DCT     = yes
>  # was renamed in FFmpeg from DOVI_RPU to CONFIG_DOVI_RPUDEC in commit 783734d979d3
>  CONFIG_DOVI_RPU = yes
>  CONFIG_DOVI_RPUDEC = yes
> +CONFIG_DOVI_RPUENC = yes
>  CONFIG_DWT     = yes
>  CONFIG_ERROR_RESILIENCE = yes
>  CONFIG_EVCPARSE = yes
> --
> 2.45.2
>

> From 666c415d86fe92efe86371fbaefece6b205170a3 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 00:54:20 +0200
> Subject: [PATCH 04/22] configure: replace AV*putFormat with FF*
>
> Like ffmpeg.
> ---
>  configure | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/configure b/configure
> index be39cbc3c..7a403e0a6 100755
> --- a/configure
> +++ b/configure
> @@ -9821,10 +9821,10 @@ print_enabled_filters(){
>  print_enabled_components libavcodec/codec_list.c FFCodec codec_list $libavdecoders $libavencoders
>  print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $libavparsers
>  print_enabled_components libavcodec/bsf_list.c FFBitStreamFilter bitstream_filters $libavbsfs
> -print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list ""
> -print_enabled_components libavdevice/outdev_list.c AVOutputFormat outdev_list ""
> -print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $libavdemuxers
> -print_enabled_components libavformat/muxer_list.c AVOutputFormat muxer_list $libavmuxers
> +print_enabled_components libavdevice/indev_list.c FFInputFormat indev_list ""
> +print_enabled_components libavdevice/outdev_list.c FFOutputFormat outdev_list ""
> +print_enabled_components libavformat/demuxer_list.c FFInputFormat demuxer_list $libavdemuxers
> +print_enabled_components libavformat/muxer_list.c FFOutputFormat muxer_list $libavmuxers
>  print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $libavprotocols
>  print_enabled_filters libavfilter/filter_list.c AVFilter filter_list $libavfilters
>
> --
> 2.45.2
>

> From 49e1aece8645ccbf8ff612fd649447e701ccb8de Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:04:41 +0200
> Subject: [PATCH 05/22] libaf/af_lavcresample: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  libaf/af_lavcresample.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libaf/af_lavcresample.c b/libaf/af_lavcresample.c
> index 7c1889083..6b0e0fb72 100644
> --- a/libaf/af_lavcresample.c
> +++ b/libaf/af_lavcresample.c
> @@ -174,7 +174,7 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data)
>
>    memcpy(s->in[0], in, in_len);
>
> -  ret = swr_convert(s->swrctx, &s->tmp[0], out_len/chans/bps, &s->in[0], in_len/chans/bps);
> +  ret = swr_convert(s->swrctx, &s->tmp[0], out_len/chans/bps, (const uint8_t *const *)&s->in[0], in_len/chans/bps);
>    if (ret < 0) return NULL;
>    out_len= ret*chans*bps;
>
> --
> 2.45.2
>

> From 09c4f533682d6098c4091cf34050fbd5dca7b706 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:05:01 +0200
> Subject: [PATCH 06/22] libmpcodecs/ad_spdif: fix type of argument
>
> ---
>  libmpcodecs/ad_spdif.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libmpcodecs/ad_spdif.c b/libmpcodecs/ad_spdif.c
> index ff3a5bdbf..926d94051 100644
> --- a/libmpcodecs/ad_spdif.c
> +++ b/libmpcodecs/ad_spdif.c
> @@ -131,7 +131,7 @@ static int init(sh_audio_t *sh)
>      // FORCE USE DTS-HD
>      if (lavf_ctx->streams[0]->codecpar->codec_id == AV_CODEC_ID_DTS)
>          av_dict_set(&opts, "dtshd_rate", "768000" /* 192000*4 */, 0);
> -    if ((res = avformat_write_header(lavf_ctx, opts)) < 0) {
> +    if ((res = avformat_write_header(lavf_ctx, &opts)) < 0) {
>          av_dict_free(&opts);
>          if (res == AVERROR_PATCHWELCOME)
>              mp_msg(MSGT_DECAUDIO,MSGL_INFO,
> --
> 2.45.2
>

> From 8ca3b7f976979d756c9fd44e436e34e771d0b9cb Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:05:27 +0200
> Subject: [PATCH 07/22] libmpcodecs/vd_ffmpeg: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  libmpcodecs/vd_ffmpeg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
> index b112a2669..2d2fc7281 100644
> --- a/libmpcodecs/vd_ffmpeg.c
> +++ b/libmpcodecs/vd_ffmpeg.c
> @@ -728,7 +728,7 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic, int isreference){
>      if (ctx->use_vdpau) {
>          VdpVideoSurface surface = (VdpVideoSurface)mpi->priv;
>          avctx->draw_horiz_band= NULL;
> -        mpi->planes[3] = surface;
> +        mpi->planes[3] = (char *)surface;
>      }
>  #endif
>
> --
> 2.45.2
>

> From d4a07dda3c5030e0470fa5d52ac15111aeccc5d0 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:06:38 +0200
> Subject: [PATCH 08/22] libmpcodecs/vf_pp: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  libmpcodecs/vf_pp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libmpcodecs/vf_pp.c b/libmpcodecs/vf_pp.c
> index 9721554d0..935677be6 100644
> --- a/libmpcodecs/vf_pp.c
> +++ b/libmpcodecs/vf_pp.c
> @@ -142,7 +142,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts, double
>
>      if(vf->priv->pp || !(mpi->flags&MP_IMGFLAG_DIRECT)){
>  	// do the postprocessing! (or copy if no DR)
> -	pp_postprocess(mpi->planes           ,mpi->stride,
> +	pp_postprocess((const uint8_t **)mpi->planes           ,mpi->stride,
>  		    vf->dmpi->planes,vf->dmpi->stride,
>  		    (mpi->w+7)&(~7),mpi->h,
>  		    mpi->qscale, mpi->qstride,
> --
> 2.45.2
>

> From aed8996aa16a0a54f05e4ef02d7fed6871777422 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:06:46 +0200
> Subject: [PATCH 09/22] libmpcodecs/vf_scale: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  libmpcodecs/vf_scale.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c
> index e48a2ad45..39deb59c2 100644
> --- a/libmpcodecs/vf_scale.c
> +++ b/libmpcodecs/vf_scale.c
> @@ -439,14 +439,14 @@ static void scale(struct SwsContext *sws1, struct SwsContext *sws2, uint8_t *src
>          int src_stride2[MP_MAX_PLANES]={2*src_stride[0], 2*src_stride[1], 2*src_stride[2], 2*src_stride[3]};
>          int dst_stride2[MP_MAX_PLANES]={2*dst_stride[0], 2*dst_stride[1], 2*dst_stride[2], 2*dst_stride[3]};
>
> -        sws_scale(sws1, src2, src_stride2, y>>1, h>>1, dst2, dst_stride2);
> +        sws_scale(sws1, (const uint8_t *const *)src2, src_stride2, y>>1, h>>1, dst2, dst_stride2);
>          for(i=0; i<MP_MAX_PLANES; i++){
>              src2[i] += src_stride[i];
>              dst2[i] += dst_stride[i];
>          }
> -        sws_scale(sws2, src2, src_stride2, y>>1, h>>1, dst2, dst_stride2);
> +        sws_scale(sws2, (const uint8_t *const *)src2, src_stride2, y>>1, h>>1, dst2, dst_stride2);
>      }else{
> -        sws_scale(sws1, src2, src_stride, y, h, dst, dst_stride);
> +        sws_scale(sws1, (const uint8_t *const *)src2, src_stride, y, h, dst, dst_stride);
>      }
>  }
>
> --
> 2.45.2
>

> From a07da75a3140667b28d4183b70f2056ec8610204 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:06:53 +0200
> Subject: [PATCH 10/22] libmpcodecs/vf_screenshot: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  libmpcodecs/vf_screenshot.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libmpcodecs/vf_screenshot.c b/libmpcodecs/vf_screenshot.c
> index e8b87fa91..4aa5ee274 100644
> --- a/libmpcodecs/vf_screenshot.c
> +++ b/libmpcodecs/vf_screenshot.c
> @@ -60,7 +60,7 @@ static void draw_slice(struct vf_instance *vf, unsigned char** src,
>                         int* stride, int w,int h, int x, int y)
>  {
>      if (vf->priv->store_slices) {
> -        sws_scale(vf->priv->ctx, src, stride, y, h, vf->priv->pic->data, vf->priv->pic->linesize);
> +        sws_scale(vf->priv->ctx, (const uint8_t *const *)src, stride, y, h, vf->priv->pic->data, vf->priv->pic->linesize);
>      }
>      vf_next_draw_slice(vf,src,stride,w,h,x,y);
>  }
> @@ -158,7 +158,7 @@ static void scale_image(struct vf_priv_s* priv, mp_image_t *mpi)
>      if (!priv->pic->data[0])
>          priv->pic->data[0] = av_malloc(priv->pic->linesize[0]*priv->dh);
>
> -    sws_scale(priv->ctx, mpi->planes, mpi->stride, 0, mpi->height, priv->pic->data, priv->pic->linesize);
> +    sws_scale(priv->ctx, (const uint8_t *const *)mpi->planes, mpi->stride, 0, mpi->height, priv->pic->data, priv->pic->linesize);
>  }
>
>  static void start_slice(struct vf_instance *vf, mp_image_t *mpi)
> --
> 2.45.2
>

> From 80cfd4b238a654420507232edec1eab684495e8a Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:07:01 +0200
> Subject: [PATCH 11/22] libmpdemux/demux_film: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  libmpdemux/demux_film.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libmpdemux/demux_film.c b/libmpdemux/demux_film.c
> index fdb391ddd..b351368e4 100644
> --- a/libmpdemux/demux_film.c
> +++ b/libmpdemux/demux_film.c
> @@ -157,7 +157,7 @@ static int demux_film_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds)
>          free(buf);
>        }
>        else {/* for 16bit */
> -        unsigned short* tmp = dp->buffer;
> +        unsigned short* tmp = (unsigned short *)dp->buffer;
>          unsigned short* buf = malloc(film_chunk.chunk_size);
>          for(i = 0; i < film_chunk.chunk_size/4; i++) {
>            buf[i*2] = tmp[i];
> --
> 2.45.2
>

> From 6ab181cb6bed5ec1ea0a6ed81eb82f96bed7fe93 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:07:07 +0200
> Subject: [PATCH 12/22] libmpdemux/demux_lavf: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  libmpdemux/demux_lavf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
> index 06a9e15cc..60b15f0f6 100644
> --- a/libmpdemux/demux_lavf.c
> +++ b/libmpdemux/demux_lavf.c
> @@ -378,7 +378,7 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) {
>          }
>          case AVMEDIA_TYPE_VIDEO:{
>              AVDictionaryEntry *rot = av_dict_get(st->metadata, "rotate",   NULL, 0);
> -            const int32_t *disp_matrix = av_stream_get_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, NULL);
> +            const int32_t *disp_matrix = (const int32_t *)av_stream_get_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, NULL);
>              sh_video_t* sh_video;
>              BITMAPINFOHEADER *bih;
>              sh_video=new_sh_video_vid(demuxer, i, priv->video_streams);
> --
> 2.45.2
>

> From 785e3d5864bb77312ad053da3a6ca40887b2cc6e Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:07:18 +0200
> Subject: [PATCH 13/22] libmpdemux/muxer_avi: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  libmpdemux/muxer_avi.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/libmpdemux/muxer_avi.c b/libmpdemux/muxer_avi.c
> index 78a666770..912e6cde2 100644
> --- a/libmpdemux/muxer_avi.c
> +++ b/libmpdemux/muxer_avi.c
> @@ -142,8 +142,8 @@ static muxer_stream_t* avifile_new_stream(muxer_t *muxer,int type){
>  static void write_avi_chunk(stream_t *stream,unsigned int id,int len,void* data){
>   int le_len = le2me_32(len);
>   int le_id = le2me_32(id);
> - stream_write_buffer(stream, &le_id, 4);
> - stream_write_buffer(stream, &le_len, 4);
> + stream_write_buffer(stream, (unsigned char *)&le_id, 4);
> + stream_write_buffer(stream, (unsigned char *)&le_len, 4);
>
>  if(len>0){
>    if(data){
> @@ -176,9 +176,9 @@ static void write_avi_list(stream_t *stream, unsigned int id, int len)
>    list_id = le2me_32(list_id);
>    le_len  = le2me_32(len);
>    le_id   = le2me_32(id);
> -  stream_write_buffer(stream, &list_id, 4);
> -  stream_write_buffer(stream, &le_len, 4);
> -  stream_write_buffer(stream, &le_id, 4);
> +  stream_write_buffer(stream, (unsigned char *)&list_id, 4);
> +  stream_write_buffer(stream, (unsigned char *)&le_len, 4);
> +  stream_write_buffer(stream, (unsigned char *)&le_id, 4);
>  }
>
>  static void avifile_odml_new_riff(muxer_t *muxer)
> @@ -199,7 +199,7 @@ static void avifile_odml_new_riff(muxer_t *muxer)
>      riff[0]=le2me_32(mmioFOURCC('R','I','F','F'));
>      riff[1]=0;
>      riff[2]=le2me_32(mmioFOURCC('A','V','I','X'));
> -    stream_write_buffer(muxer->stream, riff, 12);
> +    stream_write_buffer(muxer->stream, (unsigned char *)riff, 12);
>
>      write_avi_list(muxer->stream,listtypeAVIMOVIE,0);
>
> @@ -251,12 +251,12 @@ static void avifile_write_header(muxer_t *muxer){
>            movilen = le2me_32(rifflen - 12);
>            rifflen = le2me_32(rifflen);
>            stream_seek(muxer->stream, vsi->riffofs[i]+4);
> -          stream_write_buffer(muxer->stream,&rifflen,4);
> +          stream_write_buffer(muxer->stream,(unsigned char *)&rifflen,4);
>
>            /* fixup movi length */
>            if (i > 0) {
>                stream_seek(muxer->stream, vsi->riffofs[i]+16);
> -              stream_write_buffer(muxer->stream,&movilen,4);
> +              stream_write_buffer(muxer->stream,(unsigned char *)&movilen,4);
>            }
>        }
>
> @@ -269,7 +269,7 @@ static void avifile_write_header(muxer_t *muxer){
>      riff[0]=le2me_32(riff[0]);
>      riff[1]=le2me_32(riff[1]);
>      riff[2]=le2me_32(riff[2]);
> -    stream_write_buffer(muxer->stream,&riff,12);
> +    stream_write_buffer(muxer->stream,(unsigned char *)&riff,12);
>    }
>
>    // update AVI header:
> @@ -406,7 +406,7 @@ static void avifile_write_header(muxer_t *muxer){
>  	  idxhdr[6] = 0;
>  	  idxhdr[7] = 0;
>
> -	  stream_write_buffer(muxer->stream,idxhdr,sizeof(idxhdr));
> +	  stream_write_buffer(muxer->stream,(unsigned char *)idxhdr,sizeof(idxhdr));
>  	  for (j=0; j<n; j++) {
>  	      struct avi_odmlsuperidx_entry *entry = &si->superidx[j];
>  	      unsigned int data[4];
> @@ -414,7 +414,7 @@ static void avifile_write_header(muxer_t *muxer){
>  	      data[1] = le2me_32(entry->ofs >> 32);
>  	      data[2] = le2me_32(entry->len);
>  	      data[3] = le2me_32(entry->duration);
> -	      stream_write_buffer(muxer->stream,data,sizeof(data));
> +	      stream_write_buffer(muxer->stream,(unsigned char *)data,sizeof(data));
>  	  }
>        }
>    }
> @@ -642,13 +642,13 @@ static void avifile_odml_write_index(muxer_t *muxer){
>  	si->superidx[j].ofs = stream_tell(muxer->stream);
>  	si->superidx[j].duration = duration;
>
> -	stream_write_buffer(muxer->stream, idxhdr,sizeof(idxhdr));
> +	stream_write_buffer(muxer->stream, (unsigned char *)idxhdr,sizeof(idxhdr));
>  	for (k=0; k<entries_per_subidx && idxpos<si->idxpos; k++) {
>  	    unsigned int entry[2];
>  	    entry[0] = le2me_32(si->idx[idxpos].ofs - start);
>  	    entry[1] = le2me_32(si->idx[idxpos].len | si->idx[idxpos].flags);
>  	    idxpos++;
> -	    stream_write_buffer(muxer->stream, entry, sizeof(entry));
> +	    stream_write_buffer(muxer->stream, (unsigned char *)entry, sizeof(entry));
>  	}
>       }
>    }
> --
> 2.45.2
>

> From 0f08dea02c4273ddfff6e9f8f435c86841f4c3da Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:08:58 +0200
> Subject: [PATCH 14/22] libvo/vo_aa: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  libvo/vo_aa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libvo/vo_aa.c b/libvo/vo_aa.c
> index dc805be5b..599a938ab 100644
> --- a/libvo/vo_aa.c
> +++ b/libvo/vo_aa.c
> @@ -357,7 +357,7 @@ draw_frame(uint8_t *src[]) {
>      break;
>    }
>
> -  sws_scale(sws,src,stride,0,src_height,image,image_stride);
> +  sws_scale(sws,(const uint8_t *const *)src,stride,0,src_height,image,image_stride);
>
>     /* Now 'ASCIInate' the image */
>    if (fast)
> @@ -377,7 +377,7 @@ draw_slice(uint8_t *src[], int stride[],
>    int dx2 = screen_x + ((x+w) * screen_w / src_width);
>    int dy2 = screen_y + ((y+h) * screen_h / src_height);
>
> -  sws_scale(sws,src,stride,y,h,image,image_stride);
> +  sws_scale(sws,(const uint8_t *const *)src,stride,y,h,image,image_stride);
>
>    /* Now 'ASCIInate' the image */
>    if (fast)
> --
> 2.45.2
>

> From 7da6dd7b6cabbfb270e7f4c2ad89533f87ca8108 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:09:08 +0200
> Subject: [PATCH 15/22] libvo/vo_matrixview: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  libvo/vo_matrixview.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libvo/vo_matrixview.c b/libvo/vo_matrixview.c
> index ee2735b1c..632ec4e59 100644
> --- a/libvo/vo_matrixview.c
> +++ b/libvo/vo_matrixview.c
> @@ -170,7 +170,7 @@ static void flip_page(void)
>
>  static int draw_slice(uint8_t *src[], int stride[], int w, int h, int x, int y)
>  {
> -    sws_scale(sws, src, stride, y, h, map_image, map_stride);
> +    sws_scale(sws, (const uint8_t *const *)src, stride, y, h, map_image, map_stride);
>      return 0;
>  }
>
> --
> 2.45.2
>

> From 76ab8fcd9adcf950f411a88c106cfb68db763c95 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:09:15 +0200
> Subject: [PATCH 16/22] libvo/vo_x11: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  libvo/vo_x11.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
> index c3ec528a4..f39076810 100644
> --- a/libvo/vo_x11.c
> +++ b/libvo/vo_x11.c
> @@ -492,7 +492,7 @@ static int draw_slice(uint8_t * src[], int stride[], int w, int h,
>          dst[0] += dstStride[0] * (image_height - 1);
>          dstStride[0] = -dstStride[0];
>      }
> -    sws_scale(swsContext, src, stride, y, h, dst, dstStride);
> +    sws_scale(swsContext, (const uint8_t *const *)src, stride, y, h, dst, dstStride);
>      return 0;
>  }
>
> --
> 2.45.2
>

> From 7ec38cfd3f150618a7fe962efe50ed6a1e770191 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:09:22 +0200
> Subject: [PATCH 17/22] loader/qtx/qtxsdk/components: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  loader/qtx/qtxsdk/components.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/loader/qtx/qtxsdk/components.h b/loader/qtx/qtxsdk/components.h
> index 5ad7572d8..d3109effa 100644
> --- a/loader/qtx/qtxsdk/components.h
> +++ b/loader/qtx/qtxsdk/components.h
> @@ -780,7 +780,7 @@ static inline void dump_CodecDecompressParams(void* xxx){
>      printf("dstrect: %d;%d - %d;%d\n",cd->dstRect.top,cd->dstRect.left,cd->dstRect.bottom,cd->dstRect.right);
>      printf("wantedDestinationPixelTypes=%p\n",cd->wantedDestinationPixelTypes);
>      if(cd->wantedDestinationPixelTypes){
> -	unsigned int* p=cd->wantedDestinationPixelTypes;
> +	unsigned int* p=(unsigned *)cd->wantedDestinationPixelTypes;
>  	while(p[0]){
>  	    printf("  0x%08X %p\n",p[0],&p[0]);
>  	    ++p;
> --
> 2.45.2
>

> From 05dc5f2f4a3398a38dc0b26751d9fa8a41cb4d63 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:09:29 +0200
> Subject: [PATCH 18/22] mp_msg: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  mp_msg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mp_msg.c b/mp_msg.c
> index 67bcc067d..3b059801a 100644
> --- a/mp_msg.c
> +++ b/mp_msg.c
> @@ -70,7 +70,7 @@ const char* filename_recode(const char* filename)
>      filename_len = strlen(filename);
>      max_path = MSGSIZE_MAX - 4;
>      precoded = recoded_filename;
> -    if (iconv(inv_msgiconv, &filename, &filename_len,
> +    if (iconv(inv_msgiconv, (char **)&filename, &filename_len,
>                &precoded, &max_path) == (size_t)(-1) && errno == E2BIG) {
>          precoded[0] = precoded[1] = precoded[2] = '.';
>          precoded += 3;
> --
> 2.45.2
>

> From eb808acc93a3066517d3b446a57f193e08939878 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:09:36 +0200
> Subject: [PATCH 19/22] mplayer: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  mplayer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mplayer.c b/mplayer.c
> index 952971c09..a63d4735e 100644
> --- a/mplayer.c
> +++ b/mplayer.c
> @@ -3538,7 +3538,7 @@ goto_enable_cache:
>                  break;
>              if ((mpctx->demuxer->file_format == DEMUXER_TYPE_AVI || mpctx->demuxer->file_format == DEMUXER_TYPE_ASF || mpctx->demuxer->file_format == DEMUXER_TYPE_MOV)
>                  && stream_dump_type == 2)
> -                stream_write_buffer(os, &in_size, 4);
> +                stream_write_buffer(os, (unsigned char *)&in_size, 4);
>              if (in_size > 0) {
>                  stream_write_buffer(os, start, in_size);
>                  stream_dump_progress(in_size, mpctx->stream);
> --
> 2.45.2
>

> From f069e4d1239ce99a819a3b0882c6ea42027c0e85 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:09:43 +0200
> Subject: [PATCH 20/22] sub/sub: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  sub/sub.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sub/sub.c b/sub/sub.c
> index 142242179..7bad030d5 100644
> --- a/sub/sub.c
> +++ b/sub/sub.c
> @@ -727,7 +727,7 @@ static inline void vo_update_text_sub(mp_osd_obj_t *obj, int dxs, int dys)
>  	    // reading the subtitle words from vo_sub->text[]
>            while (*t) {
>              if (sub_utf8)
> -              c = utf8_get_char(&t);
> +              c = utf8_get_char((const char **)&t);
>              else if ((c = *t++) >= 0x80 && sub_unicode)
>                c = (c<<8) + *t++;
>  	      if (k==MAX_UCS){
> --
> 2.45.2
>

> From bcb0fde86eccb9257294973e594f558e5dd35578 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 08:51:59 +0200
> Subject: [PATCH 21/22] sub/spudec: explicit pointer casts
>
> Recent compilers consider implicit casts an error.
> ---
>  sub/spudec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sub/spudec.c b/sub/spudec.c
> index eefc235d4..516ce52e6 100644
> --- a/sub/spudec.c
> +++ b/sub/spudec.c
> @@ -897,9 +897,9 @@ static void sws_spu_image(unsigned char *d1, unsigned char *d2, int dw, int dh,
>  	}
>
>  	ctx=sws_getContext(sw, sh, AV_PIX_FMT_GRAY8, dw, dh, AV_PIX_FMT_GRAY8, SWS_GAUSS, &filter, NULL, NULL);
> -	sws_scale(ctx,&s1,&ss,0,sh,&d1,&ds);
> +	sws_scale(ctx,(const uint8_t *const *)&s1,&ss,0,sh,&d1,&ds);
>  	for (i=ss*sh-1; i>=0; i--) s2[i] = -s2[i];
> -	sws_scale(ctx,&s2,&ss,0,sh,&d2,&ds);
> +	sws_scale(ctx,(const uint8_t *const *)&s2,&ss,0,sh,&d2,&ds);
>  	for (i=ds*dh-1; i>=0; i--) d2[i] = -d2[i];
>  	sws_freeContext(ctx);
>  }
> --
> 2.45.2
>

> From 098cc90a691e7374e88d37d00c3e256a15830404 Mon Sep 17 00:00:00 2001
> From: Nicolas George <george at nsup.org>
> Date: Fri, 20 Sep 2024 01:08:06 +0200
> Subject: [PATCH 22/22] libvo/gl_common: fix incompatible pointer types
>
> ---
>  libvo/gl_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libvo/gl_common.c b/libvo/gl_common.c
> index f59309bde..08cfc2cf1 100644
> --- a/libvo/gl_common.c
> +++ b/libvo/gl_common.c
> @@ -2239,7 +2239,7 @@ static XVisualInfo *getWindowVisualInfo(Window win) {
>    XVisualInfo vinfo_template;
>    int tmp;
>    if (!XGetWindowAttributes(mDisplay, win, &xw_attr))
> -    return DefaultVisual(mDisplay, 0);
> +    xw_attr.visual = DefaultVisual(mDisplay, 0);
>    vinfo_template.visualid = XVisualIDFromVisual(xw_attr.visual);
>    return XGetVisualInfo(mDisplay, VisualIDMask, &vinfo_template, &tmp);
>  }
> --
> 2.45.2
>

> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng


  Alexander


More information about the MPlayer-dev-eng mailing list