[MPlayer-dev-eng] [PATCH] demuxers cleanup (was Re: [PATCH] misc small fixes (mostly gcc warnings) )

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Sun Nov 27 18:50:22 CET 2005


On Sunday, 27 November 2005 at 18:34, Diego Biurrun wrote:
> On Sun, Nov 27, 2005 at 03:04:56AM +0100, Dominik 'Rathann' Mierzejewski wrote:
> > On Sunday, 27 November 2005 at 02:44, The Wanderer wrote:
> > > On 11/13/2005 05:38 PM, Dominik 'Rathann' Mierzejewski wrote:
> > > 
> > > >On Sunday, 13 November 2005 at 20:07, Roberto Togni wrote:
> > > >
> > > >>There was both seek functions returning int and seek functions
> > > >>returning void before the demuxer patch, but in every case the
> > > >>return value was ignored. Probably i forgot to change these to
> > > >>void. If we prefer to change them all to int we can talk about it,
> > > >>but if we don't do anything with the result i see no reason to do
> > > >>it.
> > > >
> > > >The return values are indeed ignored everywhere. Here's a patch that
> > > >makes all the remaining non-void demuxer seek/close functions void.
> > > >Apply it or decide on the return value semantics. ;)
> > > 
> > > What's the status of this patch?
> > 
> > Undecided, because Reimar and Rich didn't agree either way.

And Roberto. ;)

> Try to isolate the uncontroversial parts and commit those then.

Here's what I'd like to commit:

R.

-- 
MPlayer RPMs maintainer: http://rpm.greysector.net/mplayer/
"I am Grey. I stand between the candle and the star. We are Grey.
 We stand between the darkness ... and the light."
        -- Delenn in Grey Council in Babylon 5:"Babylon Squared"
-------------- next part --------------
--- MPlayer-20051109/liba52/Makefile.warn	2004-08-27 22:37:27.000000000 +0200
+++ MPlayer-20051109/liba52/Makefile	2005-11-13 01:25:24.000000000 +0100
@@ -6,7 +6,7 @@
 SRCS    = crc.c resample.c bit_allocate.c bitstream.c downmix.c imdct.c imdct_mlib.c parse.c
 OBJS	= $(SRCS:.c=.o)
 
-CFLAGS  = $(MLIB_INC) $(OPTFLAGS) 
+CFLAGS  = $(MLIB_INC) $(OPTFLAGS) -I..
 
 .SUFFIXES: .c .o
 
--- MPlayer-20051109/libao2/ao_alsa.c.warn	2005-09-04 22:36:27.000000000 +0200
+++ MPlayer-20051109/libao2/ao_alsa.c	2005-11-12 20:35:30.000000000 +0100
@@ -112,7 +112,7 @@
 	 char *test_mix_index;
 
 	 mix_name = strdup(mixer_channel);
-	 if (test_mix_index = strchr(mix_name, ',')){
+	 if ((test_mix_index = strchr(mix_name, ','))){
 		*test_mix_index = 0;
 		test_mix_index++;
 		mix_index = strtol(test_mix_index, &test_mix_index, 0);
--- MPlayer-20051109/libdha/sysdep/pci_linux.c.warn	2004-07-09 21:22:28.000000000 +0200
+++ MPlayer-20051109/libdha/sysdep/pci_linux.c	2005-11-12 20:35:29.000000000 +0100
@@ -5,7 +5,8 @@
 */
 #include <errno.h>
 #ifdef __i386__
-// is this needed? #include <sys/perm.h>
+//#include <sys/perm.h> doesn't exist on libc5 systems
+int iopl();
 #else
 #if !defined(__sparc__) && !defined(__powerpc__) && !defined(__x86_64__)
 #include <sys/io.h>
--- MPlayer-20051109/libmpcodecs/vf_phase.c.warn	2004-09-03 03:42:04.000000000 +0200
+++ MPlayer-20051109/libmpcodecs/vf_phase.c	2005-11-12 20:35:29.000000000 +0100
@@ -59,7 +59,7 @@
  * (the result is actually multiplied by 25)
  */
 
-#define diff(a, as, b, bs) (t=(*a-b[bs]<<2)+a[as<<1]-b[-bs], t*t)
+#define diff(a, as, b, bs) (t=((*a-b[bs])<<2)+a[as<<1]-b[-bs], t*t)
 
 /*
  * Find which field combination has the smallest average squared difference
--- MPlayer-20051109/libmpcodecs/ad_libvorbis.c.warn	2005-08-20 19:40:06.000000000 +0200
+++ MPlayer-20051109/libmpcodecs/ad_libvorbis.c	2005-11-12 20:35:30.000000000 +0100
@@ -60,7 +60,8 @@
 
 static int init(sh_audio_t *sh)
 {
-  unsigned int offset, i, length, hsizes[3], *headers[3];
+  unsigned int offset, i, length, hsizes[3];
+  void *headers[3];
   unsigned char* extradata;
   ogg_packet op;
   vorbis_comment vc;
--- MPlayer-20051109/libmpcodecs/ae_lavc.c.warn	2005-05-17 23:49:48.000000000 +0200
+++ MPlayer-20051109/libmpcodecs/ae_lavc.c	2005-11-12 20:35:29.000000000 +0100
@@ -26,6 +26,9 @@
 extern int  lavc_param_atag;
 extern int  avcodec_inited;
 static int compressed_frame_size = 0;
+#ifdef USE_LIBAVFORMAT
+extern unsigned int codec_get_wav_tag(int id);
+#endif
 
 static int bind_lavc(audio_encoder_t *encoder, muxer_stream_t *mux_a)
 {
--- MPlayer-20051109/libmpcodecs/ad_acm.c.warn	2005-09-04 22:36:28.000000000 +0200
+++ MPlayer-20051109/libmpcodecs/ad_acm.c	2005-11-12 20:35:30.000000000 +0100
@@ -11,6 +11,7 @@
 #include "wineacm.h"
 
 #include "ad_internal.h"
+#include "osdep/timer.h"
 
 static ad_info_t info = 
 {
--- MPlayer-20051109/libmpdemux/realrtsp/rtsp.c.warn	2005-09-04 22:36:29.000000000 +0200
+++ MPlayer-20051109/libmpdemux/realrtsp/rtsp.c	2005-11-12 20:35:30.000000000 +0100
@@ -52,6 +52,7 @@
 #include "../stream.h"
 #include "../demuxer.h"
 #include "rtsp_session.h"
+#include "osdep/timer.h"
 
 /*
 #define LOG
--- MPlayer-20051109/libmpdemux/stream_livedotcom.c.warn	2005-10-03 03:10:17.000000000 +0200
+++ MPlayer-20051109/libmpdemux/stream_livedotcom.c	2005-11-12 20:35:30.000000000 +0100
@@ -56,7 +56,7 @@
 }
 
 static int open_live_sdp(stream_t *stream,int mode, void* opts, int* file_format) {
-  FILE *f;
+  int f;
   char *filename = stream->url;
   off_t len;
   char* sdpDescription;
@@ -93,6 +93,7 @@
     *file_format = DEMUXER_TYPE_RTP;
     return STREAM_OK;
   }
+  return STREAM_UNSUPORTED;
 }
 
 
--- MPlayer-20051109/libmpdemux/demux_film.c.warn	2005-08-06 02:41:22.000000000 +0200
+++ MPlayer-20051109/libmpdemux/demux_film.c	2005-11-12 20:35:30.000000000 +0100
@@ -144,7 +144,7 @@
         memcpy( tmp, buf, film_chunk.chunk_size );
       }
       else {/* for 16bit */
-        unsigned short* tmp = dp->buffer;
+        unsigned short* tmp = (unsigned short *)(dp->buffer);
         unsigned short  buf[film_chunk.chunk_size/2];
         for(i = 0; i < film_chunk.chunk_size/4; i++) {
           buf[i*2] = tmp[i];
--- MPlayer-20051109/libmpdemux/muxer_mpeg.c.warn	2005-11-06 18:35:33.000000000 +0100
+++ MPlayer-20051109/libmpdemux/muxer_mpeg.c	2005-11-12 20:35:30.000000000 +0100
@@ -19,6 +19,8 @@
 #include "stheader.h"
 #include "../m_option.h"
 #include "mpeg_hdr.h"
+#include "mp3_hdr.h"
+#include "liba52/a52.h"
 
 #define PACK_HEADER_START_CODE 0x01ba
 #define SYSTEM_HEADER_START_CODE 0x01bb
--- MPlayer-20051109/libmpdemux/demux_ogg.c.warn	2005-11-06 18:35:33.000000000 +0100
+++ MPlayer-20051109/libmpdemux/demux_ogg.c	2005-11-12 20:35:30.000000000 +0100
@@ -29,6 +29,7 @@
 
 #ifdef HAVE_OGGTHEORA
 #include <theora/theora.h>
+extern int _ilog (unsigned int); /* defined in many places in theora/lib/ */
 #endif
 
 #define BLOCK_SIZE 4096
--- MPlayer-20051109/libmpdemux/pnm.c.warn	2005-09-04 22:36:28.000000000 +0200
+++ MPlayer-20051109/libmpdemux/pnm.c	2005-11-12 20:35:30.000000000 +0100
@@ -47,6 +47,7 @@
 #include "stream.h"
 #include "demuxer.h"
 #include "help_mp.h"
+#include "osdep/timer.h"
 
 #include "pnm.h"
 //#include "libreal/rmff.h"
--- MPlayer-20051109/libvo/sub.h.warn	2004-11-01 15:47:55.000000000 +0100
+++ MPlayer-20051109/libvo/sub.h	2005-11-12 20:35:30.000000000 +0100
@@ -117,6 +117,7 @@
 int vo_update_osd(int dxs,int dys);
 int vo_osd_changed(int new_value);
 int vo_osd_check_range_update(int,int,int,int);
+void free_osd_list();
 
 extern int vo_osd_changed_flag;
 
--- MPlayer-20051109/libvo/fastmemcpy.h.warn	2005-04-10 19:11:47.000000000 +0200
+++ MPlayer-20051109/libvo/fastmemcpy.h	2005-11-12 20:35:30.000000000 +0100
@@ -20,7 +20,7 @@
 #define mem2agpcpy(a,b,c) memcpy(a,b,c)
 #endif
 
-static inline void * mem2agpcpy_pic(void * dst, void * src, int bytesPerLine, int height, int dstStride, int srcStride)
+static inline void * mem2agpcpy_pic(void * dst, const void * src, int bytesPerLine, int height, int dstStride, int srcStride)
 {
 	int i;
 	void *retval=dst;
@@ -48,7 +48,7 @@
 	return retval;
 }
 
-static inline void * memcpy_pic(void * dst, void * src, int bytesPerLine, int height, int dstStride, int srcStride)
+static inline void * memcpy_pic(void * dst, const void * src, int bytesPerLine, int height, int dstStride, int srcStride)
 {
 	int i;
 	void *retval=dst;
--- MPlayer-20051109/libfaad2/ps_dec.c.warn	2005-02-28 01:17:11.000000000 +0100
+++ MPlayer-20051109/libfaad2/ps_dec.c	2005-11-12 20:35:30.000000000 +0100
@@ -1935,8 +1935,8 @@
 /* main Parametric Stereo decoding function */
 uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64])
 {
-    qmf_t X_hybrid_left[32][32] = {{0}};
-    qmf_t X_hybrid_right[32][32] = {{0}};
+    qmf_t X_hybrid_left[32][32] = {{{0}}};
+    qmf_t X_hybrid_right[32][32] = {{{0}}};
 
     /* delta decoding of the bitstream data */
     ps_data_decode(ps);
--- MPlayer-20051109/libfaad2/sbr_dec.c.warn	2005-02-28 01:17:11.000000000 +0100
+++ MPlayer-20051109/libfaad2/sbr_dec.c	2005-11-12 20:35:30.000000000 +0100
@@ -527,8 +527,8 @@
     uint8_t l, k;
     uint8_t dont_process = 0;
     uint8_t ret = 0;
-    ALIGN qmf_t X_left[38][64] = {{0}};
-    ALIGN qmf_t X_right[38][64] = {{0}}; /* must set this to 0 */
+    ALIGN qmf_t X_left[38][64] = {{{0}}};
+    ALIGN qmf_t X_right[38][64] = {{{0}}}; /* must set this to 0 */
 
     if (sbr == NULL)
         return 20;
--- MPlayer-20051109/mplayer.c.warn	2005-11-09 01:05:33.000000000 +0100
+++ MPlayer-20051109/mplayer.c	2005-11-12 20:35:30.000000000 +0100
@@ -114,6 +114,7 @@
 #ifdef HAS_DVBIN_SUPPORT
 #include "libmpdemux/dvbin.h"
 static int last_dvb_step = 1;
+extern void cache_uninit(stream_t *s);
 #endif
 
 //**************************************************************************//
@@ -186,6 +187,7 @@
 #include "libmpcodecs/dec_video.h"
 #include "libmpcodecs/mp_image.h"
 #include "libmpcodecs/vf.h"
+#include "libmpcodecs/vd.h"
 
 extern void vf_list_plugins();
 


More information about the MPlayer-dev-eng mailing list