[packages/mplayer] - some type fixes, still not enough

qboosh qboosh at pld-linux.org
Thu Aug 14 21:41:18 CEST 2025


commit be3c104434680e80f7e0ad4e979e1af0ff233c27
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Aug 14 21:43:43 2025 +0200

    - some type fixes, still not enough

 mplayer-types.patch | 208 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 mplayer.spec        |   2 +
 2 files changed, 210 insertions(+)
---
diff --git a/mplayer.spec b/mplayer.spec
index 95a6d10..d72eb28 100644
--- a/mplayer.spec
+++ b/mplayer.spec
@@ -177,6 +177,7 @@ Patch33:	binutils2.41.patch
 Patch34:	po-charset.patch
 
 Patch101:	%{name}-link.patch
+Patch102:	%{name}-types.patch
 
 URL:		http://www.mplayerhq.hu/
 %{?with_directfb:BuildRequires:	DirectFB-devel >= 0.9.22}
@@ -447,6 +448,7 @@ cp -f etc/codecs.conf etc/codecs.win32.conf
 %patch -P34 -p1
 
 %patch -P101 -p1
+%patch -P102 -p1
 
 cat etc/example.conf > etc/mplayer.conf
 cat <<'CONFIGADD' >> etc/mplayer.conf
diff --git a/mplayer-types.patch b/mplayer-types.patch
new file mode 100644
index 0000000..500e549
--- /dev/null
+++ b/mplayer-types.patch
@@ -0,0 +1,208 @@
+--- MPlayer-1.5/mplayer.c.orig	2021-01-25 20:10:32.000000000 +0100
++++ MPlayer-1.5/mplayer.c	2025-08-14 19:41:56.394431756 +0200
+@@ -2430,7 +2430,8 @@ int reinit_video_chain(void)
+     return 1;
+ 
+ err_out:
+-    mpctx->sh_video = mpctx->sh_video->ds = NULL;
++    mpctx->sh_video = NULL;
++    mpctx->sh_video->ds = NULL;
+     return 0;
+ }
+ 
+@@ -3527,7 +3528,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, (void*)&in_size, 4);
+             if (in_size > 0) {
+                 stream_write_buffer(os, start, in_size);
+                 stream_dump_progress(in_size, mpctx->stream);
+--- MPlayer-1.5/libvo/vo_aa.c.orig	2021-01-23 19:22:09.000000000 +0100
++++ MPlayer-1.5/libvo/vo_aa.c	2025-08-14 19:47:21.889668398 +0200
+@@ -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)
+--- MPlayer-1.5/libvo/vo_matrixview.c.orig	2021-01-23 19:22:09.000000000 +0100
++++ MPlayer-1.5/libvo/vo_matrixview.c	2025-08-14 19:49:36.047119628 +0200
+@@ -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;
+ }
+ 
+--- MPlayer-1.5/libvo/mga_template.c.orig	2016-02-20 14:30:50.000000000 +0100
++++ MPlayer-1.5/libvo/mga_template.c	2025-08-14 19:50:18.824036495 +0200
+@@ -77,7 +77,7 @@ draw_slice_g200(uint8_t *image[], int st
+ 	av_image_fill_pointers(dst, AV_PIX_FMT_NV12, mga_vid_config.src_height,
+ 	                       vid_data, dst_stride);
+ 
+-	sws_scale(sws_ctx, image, stride, y, height, dst, dst_stride);
++	sws_scale(sws_ctx, (const uint8_t *const *)image, stride, y, height, dst, dst_stride);
+ }
+ 
+ static void
+--- MPlayer-1.5/libvo/vo_x11.c.orig	2014-01-18 22:39:07.000000000 +0100
++++ MPlayer-1.5/libvo/vo_x11.c	2025-08-14 19:50:41.150833750 +0200
+@@ -492,7 +492,7 @@ static int draw_slice(uint8_t * src[], i
+         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;
+ }
+ 
+--- MPlayer-1.5/mp_msg.c.orig	2021-01-23 19:22:09.000000000 +0100
++++ MPlayer-1.5/mp_msg.c	2025-08-14 19:52:44.718223158 +0200
+@@ -70,7 +70,7 @@ const char* filename_recode(const char*
+     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;
+--- MPlayer-1.5/libmpcodecs/vf_scale.c.orig	2020-11-01 16:07:47.000000000 +0100
++++ MPlayer-1.5/libmpcodecs/vf_scale.c	2025-08-14 20:19:47.154379638 +0200
+@@ -439,14 +439,14 @@ static void scale(struct SwsContext *sws
+         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);
+     }
+ }
+ 
+--- MPlayer-1.5/libmpdemux/demux_film.c.orig	2021-01-23 19:22:13.000000000 +0100
++++ MPlayer-1.5/libmpdemux/demux_film.c	2025-08-14 20:21:07.488182864 +0200
+@@ -157,7 +157,7 @@ static int demux_film_fill_buffer(demuxe
+         free(buf);
+       }
+       else {/* for 16bit */
+-        unsigned short* tmp = dp->buffer;
++        unsigned short* tmp = (void*)(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];
+--- MPlayer-1.5/loader/qtx/qtxsdk/components.h.orig	2025-08-14 21:14:59.937138889 +0200
++++ MPlayer-1.5/loader/qtx/qtxsdk/components.h	2025-08-14 21:15:02.530487472 +0200
+@@ -749,6 +749,7 @@ static inline void dump_CodecCapabilitie
+     printf("=========================================================\n");
+ }
+ 
++#if 0
+ static inline void dump_CodecDecompressParams(void* xxx){
+     CodecDecompressParams* cd=xxx;
+     ImageDescription **idh;
+@@ -797,5 +798,6 @@ static inline void dump_CodecDecompressP
+ 
+ 
+ }
++#endif
+ 
+ #endif /* MPLAYER_COMPONENTS_H */
+--- MPlayer-1.5/sub/spudec.c.orig	2021-01-23 19:22:09.000000000 +0100
++++ MPlayer-1.5/sub/spudec.c	2025-08-14 21:15:42.167387194 +0200
+@@ -899,7 +899,7 @@ static void sws_spu_image(unsigned char
+ 	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);
+ 	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);
+ }
+--- MPlayer-1.5/sub/sub.c.orig	2020-06-14 19:55:21.000000000 +0200
++++ MPlayer-1.5/sub/sub.c	2025-08-14 21:16:31.554344245 +0200
+@@ -727,7 +727,7 @@ static inline void vo_update_text_sub(mp
+ 	    // 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){
+--- MPlayer-1.5/libaf/af_lavcresample.c.orig	2016-02-13 18:32:14.000000000 +0100
++++ MPlayer-1.5/libaf/af_lavcresample.c	2025-08-14 21:19:47.702164215 +0200
+@@ -156,7 +156,7 @@ static af_data_t* play(struct af_instanc
+ 
+   memcpy(s->in[0], in, in_len);
+ 
+-  ret = swr_convert(s->swrctx, &s->tmp[0], out_len/chans/2, &s->in[0], in_len/chans/2);
++  ret = swr_convert(s->swrctx, &s->tmp[0], out_len/chans/2, (const uint8_t**)&s->in[0], in_len/chans/2);
+   if (ret < 0) return NULL;
+   out_len= ret*chans*2;
+ 
+--- MPlayer-1.5/libmpcodecs/vd_ffmpeg.c.orig	2021-05-01 19:45:31.000000000 +0200
++++ MPlayer-1.5/libmpcodecs/vd_ffmpeg.c	2025-08-14 21:22:12.163013613 +0200
+@@ -739,7 +739,7 @@ static int get_buffer(AVCodecContext *av
+     if (ctx->use_vdpau) {
+         VdpVideoSurface surface = (VdpVideoSurface)mpi->priv;
+         avctx->draw_horiz_band= NULL;
+-        mpi->planes[3] = surface;
++        mpi->planes[3] = (void*)surface;
+     }
+ #endif
+ #if CONFIG_XVMC
+--- MPlayer-1.5/libmpcodecs/vf_screenshot.c.orig	2021-05-01 19:45:31.000000000 +0200
++++ MPlayer-1.5/libmpcodecs/vf_screenshot.c	2025-08-14 21:23:33.090156112 +0200
+@@ -60,7 +60,7 @@ static void draw_slice(struct vf_instanc
+                        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
+     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)
+--- MPlayer-1.5/libmpcodecs/vf_pp.c.orig	2017-04-29 13:09:30.000000000 +0200
++++ MPlayer-1.5/libmpcodecs/vf_pp.c	2025-08-14 21:24:40.580552940 +0200
+@@ -142,7 +142,7 @@ static int put_image(struct vf_instance
+ 
+     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,
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mplayer.git/commitdiff/be3c104434680e80f7e0ad4e979e1af0ff233c27



More information about the pld-cvs-commit mailing list