Package-Name: xine-lib
Gentoo-Package: media-libs/xine-lib
Requires: zlib libpng
Suggests: XFree86|Xorg SDL
Homepage: http://xine.sourceforge.net/
Source: sourceforge:///xine/xine-lib-(\d+(.\d+)*)(-(rc[0-9]+[a-z]*))?.tar.gz $1$4
Zap-Before-Install: 1
Repack:
	tar xzvfp "$(SOURCE)"
	test -d xine-lib-"$(VERSION)" || mv xine-lib* xine-lib-"$(VERSION)"
Compile:
	cp -pf COPYING Change* NEWS README TODO "$(PREFIX)/"
	# Disable ImageMagick
	ac_cv_path_WAND_CONFIG=no $(MAKE) -f ../Makefile configure CONFIGURE_OPTS="--enable-shared --disable-static" CUSTOM_CFLAGS="-O3 -I$(PREFIX)/../SDL/include"
# FIXME: wants libpng.so, not libpng.a
	$(MAKE) PNG_LIBS="-L$(PREFIX)/../libpng/lib -lpng"
	$(MAKE) install
Install:
	$(MAKE) instbin BIN=xine-config
	$(MAKE) instpc PC=libxine
	$(MAKE) addldso
	$(MAKE) instman SECTION=1 MAN=xine-config
#	$(MAKE) instman SECTION=3 MAN="ao_driver_t ao_functions_t audio_cap audio_group audio_prop autoplay_group browse_group build_info cfg_data_t config_group config_values_s config_values_t demux_strategy event_group loadplugins_group mrl_t mrl_types status_group ui_callbacks version_group video_cap video_group video_prop video_ratio visual_types vo_driver_s vo_driver_t vo_frame_t vo_overlay_t xine-lib xine.h xine_api xine_init xine_management xine_t xine_version"
Clean:
	@set -e ; cd "$(PREFIX)"/lib ; \
	for lib in *.so.[0-9] ; do \
		reallib=`/bin/ls -l "$$lib" | sed 's/.* -> //'` ; \
		for file in $$lib.[0-9]*.[0-9]* ; do \
			if test "$$file" != "$$reallib" ; then \
				rm -fv "$$file" ; \
			fi ; \
		done ; \
	done
NoPatch: <<EOT
######## begin GCC 4 fixes (1/2: errors)
--- ../xine-lib-1.0.1-orig/src/xine-utils/color.c	2005-04-26 17:09:15 +0900
+++ src/xine-utils/color.c	2005-05-21 23:13:31 +0900
@@ -495,8 +495,10 @@
 
   /* process blocks of 4 pixels */
   for (x=0; x < (width / 4); x++) {
-    n1  = *(((unsigned int *) src1)++);
-    n2  = *(((unsigned int *) src2)++);
+    n1  = *((unsigned int *) src1);
+    src1 += 4;
+    n2  = *((unsigned int *) src2);
+    src2 += 4;
     n3  = (n1 & 0xFF00FF00) >> 8;
     n4  = (n2 & 0xFF00FF00) >> 8;
     n1 &= 0x00FF00FF;
--- ../xine-lib-1.0.1-orig/src/xine-utils/memcpy.c	2005-04-26 17:09:15 +0900
+++ src/xine-utils/memcpy.c	2005-05-21 23:15:42 +0900
@@ -218,8 +218,8 @@
         "movntps %%xmm2, 32(%1)\n"
         "movntps %%xmm3, 48(%1)\n"
         :: "r" (from), "r" (to) : "memory");
-        ((const unsigned char *)from)+=64;
-        ((unsigned char *)to)+=64;
+        from = ((const unsigned char *)from)+64;
+        to = ((unsigned char *)to)+64;
       }
     else
       /*
@@ -241,8 +241,8 @@
         "movntps %%xmm2, 32(%1)\n"
         "movntps %%xmm3, 48(%1)\n"
         :: "r" (from), "r" (to) : "memory");
-        ((const unsigned char *)from)+=64;
-        ((unsigned char *)to)+=64;
+        from = ((const unsigned char *)from)+64;
+        to = ((unsigned char *)to)+64;
       }
     /* since movntq is weakly-ordered, a "sfence"
      * is needed to become ordered again. */
@@ -296,8 +296,8 @@
       "movq %%mm6, 48(%1)\n"
       "movq %%mm7, 56(%1)\n"
       :: "r" (from), "r" (to) : "memory");
-      ((const unsigned char *)from)+=64;
-      ((unsigned char *)to)+=64;
+      from = ((const unsigned char *)from)+64;
+      to = ((unsigned char *)to)+64;
     }
     __asm__ __volatile__ ("emms":::"memory");
   }
@@ -363,8 +363,8 @@
       "movntq %%mm6, 48(%1)\n"
       "movntq %%mm7, 56(%1)\n"
       :: "r" (from), "r" (to) : "memory");
-      ((const unsigned char *)from)+=64;
-      ((unsigned char *)to)+=64;
+      from = ((const unsigned char *)from)+64;
+      to = ((unsigned char *)to)+64;
     }
      /* since movntq is weakly-ordered, a "sfence"
      * is needed to become ordered again. */
--- ../xine-lib-1.0.1-orig/src/xine-engine/post.c	2005-04-26 17:09:12 +0900
+++ src/xine-engine/post.c	2005-05-21 23:25:12 +0900
@@ -241,7 +241,7 @@
     if (!*input) return port;
     (*input)->xine_in.name = "video in";
     (*input)->xine_in.type = XINE_POST_DATA_VIDEO;
-    (xine_video_port_t *)(*input)->xine_in.data = &port->new_port;
+    (*input)->xine_in.data = &port->new_port;
     (*input)->post = post;
     xine_list_append_content(post->input, *input);
   }
@@ -251,7 +251,7 @@
     if (!*output) return port;
     (*output)->xine_out.name = "video out";
     (*output)->xine_out.type = XINE_POST_DATA_VIDEO;
-    (xine_video_port_t **)(*output)->xine_out.data = &port->original_port;
+    (*output)->xine_out.data = &port->original_port;
     (*output)->xine_out.rewire = post_video_rewire;
     (*output)->post = post;
     (*output)->user_data = port;
@@ -718,7 +718,7 @@
     if (!*input) return port;
     (*input)->xine_in.name = "audio in";
     (*input)->xine_in.type = XINE_POST_DATA_AUDIO;
-    (xine_audio_port_t *)(*input)->xine_in.data = &port->new_port;
+    (*input)->xine_in.data = &port->new_port;
     (*input)->post = post;
     xine_list_append_content(post->input, *input);
   }
@@ -728,7 +728,7 @@
     if (!*output) return port;
     (*output)->xine_out.name = "audio out";
     (*output)->xine_out.type = XINE_POST_DATA_AUDIO;
-    (xine_audio_port_t **)(*output)->xine_out.data = &port->original_port;
+    (*output)->xine_out.data = &port->original_port;
     (*output)->xine_out.rewire = post_audio_rewire;
     (*output)->post = post;
     (*output)->user_data = port;
--- ../xine-lib-1.0.1-orig/src/video_out/vidix/drivers/pm3_regs.h	2005-04-26 17:09:11 +0900
+++ src/video_out/vidix/drivers/pm3_regs.h	2005-05-21 23:29:33 +0900
@@ -1187,7 +1187,7 @@
 #define write_mem_barrier()
 #endif
 
-extern void *pm3_reg_base;
+static void *pm3_reg_base;
 
 #define WRITE_REG(offset,val)						\
     do {								\
--- ../xine-lib-1.0.1-orig/src/libffmpeg/libavcodec/common.h	2005-04-26 17:09:09 +0900
+++ src/libffmpeg/libavcodec/common.h	2005-05-21 23:55:45 +0900
@@ -66,6 +66,7 @@
 #define AVOPTION_SUB(ptr) { .name = NULL, .help = (const char*)ptr }
 #define AVOPTION_END() AVOPTION_SUB(NULL)
 
+#if 0
 struct AVOption;
 #ifdef HAVE_MMX
 extern const struct AVOption avoptions_common[3 + 5];
@@ -73,6 +74,7 @@
 extern const struct AVOption avoptions_common[3];
 #endif
 extern const struct AVOption avoptions_workaround_bug[11];
+#endif
 
 #endif /* HAVE_AV_CONFIG_H */
 
--- ../xine-lib-1.0.1-orig/src/libffmpeg/libavcodec/i386/dsputil_mmx.c	2005-04-26 17:09:09 +0900
+++ src/libffmpeg/libavcodec/i386/dsputil_mmx.c	2005-05-21 23:58:32 +0900
@@ -649,17 +649,19 @@
         "movd %%mm3, %2			\n\t"
         "punpckhdq %%mm3, %%mm3		\n\t"
         "movd %%mm3, %3			\n\t"
-        "movd %%mm1, %4			\n\t"
-        "punpckhdq %%mm1, %%mm1		\n\t"
-        "movd %%mm1, %5			\n\t"
-        "movd %%mm6, %6			\n\t"
-        "punpckhdq %%mm6, %%mm6		\n\t"
-        "movd %%mm6, %7			\n\t"
         : "=m" (*(uint32_t*)(src + 0*stride)),
           "=m" (*(uint32_t*)(src + 1*stride)),
           "=m" (*(uint32_t*)(src + 2*stride)),
-          "=m" (*(uint32_t*)(src + 3*stride)),
-          "=m" (*(uint32_t*)(src + 4*stride)),
+          "=m" (*(uint32_t*)(src + 3*stride))
+    );
+    asm volatile(
+        "movd %%mm1, %0			\n\t"
+        "punpckhdq %%mm1, %%mm1		\n\t"
+        "movd %%mm1, %1			\n\t"
+        "movd %%mm6, %2			\n\t"
+        "punpckhdq %%mm6, %%mm6		\n\t"
+        "movd %%mm6, %3			\n\t"
+        : "=m" (*(uint32_t*)(src + 4*stride)),
           "=m" (*(uint32_t*)(src + 5*stride)),
           "=m" (*(uint32_t*)(src + 6*stride)),
           "=m" (*(uint32_t*)(src + 7*stride))
--- ../xine-lib-1.0.1-orig/src/libffmpeg/libavcodec/h263dec.c	2005-04-26 17:09:09 +0900
+++ src/libffmpeg/libavcodec/h263dec.c	2005-05-22 00:01:20 +0900
@@ -762,7 +762,9 @@
 
 static const AVOption mpeg4_decoptions[] =
 {
+#if 0
     AVOPTION_SUB(avoptions_workaround_bug),
+#endif
     AVOPTION_END()
 };
 
--- ../xine-lib-1.0.1-orig/src/libffmpeg/libavcodec/mpegvideo.c	2005-04-26 17:09:09 +0900
+++ src/libffmpeg/libavcodec/mpegvideo.c	2005-05-22 00:07:00 +0900
@@ -5925,7 +5925,9 @@
 		        flags, CODEC_FLAG_PSNR, 0),
     AVOPTION_CODEC_RCOVERRIDE("rc_override", "ratecontrol override (=startframe,endframe,qscale,quality_factor)",
 			      rc_override),
+#if 0
     AVOPTION_SUB(avoptions_common),
+#endif
     AVOPTION_END()
 };
 
--- ../xine-lib-1.0.1-orig/src/libw32dll/wine/ext.c	2005-04-26 17:09:14 +0900
+++ src/libw32dll/wine/ext.c	2005-05-22 00:11:27 +0900
@@ -469,7 +469,7 @@
 
     if (type&MEM_RESERVE && (unsigned)address&0xffff) {
        size += (unsigned)address&0xffff;
-       (unsigned)address &= ~0xffff;
+       address = (LPVOID)((unsigned)address&~0xffff);
     }
     pgsz = sysconf(_SC_PAGESIZE);
     if (type&MEM_COMMIT && (unsigned)address%pgsz) {
--- ../xine-lib-1.0.1-orig/src/libw32dll/wine/win32.c	2005-04-26 17:09:14 +0900
+++ src/libw32dll/wine/win32.c	2005-05-22 00:12:13 +0900
@@ -2623,7 +2623,7 @@
     dbgprintf("GetWindowThreadProcessId(0x%x, 0x%x) => %d\n",
 	win, pid_data, tid);
     if (pid_data)
-	(int)*pid_data = tid;
+	*pid_data = tid;
     return tid;
 }
 
--- ../xine-lib-1.0.1-orig/src/libw32dll/wine/loader.h	2005-04-26 17:09:14 +0900
+++ src/libw32dll/wine/loader.h	2005-05-22 00:16:54 +0900
@@ -17,7 +17,6 @@
 extern "C" {
 #endif
 
-extern char* win32_codec_name;  // must be set before calling DrvOpen() !!!
 
 unsigned int _GetPrivateProfileIntA(const char* appname, const char* keyname, int default_value, const char* filename);
 int _GetPrivateProfileStringA(const char* appname, const char* keyname,
--- ../xine-lib-1.0.1-orig/src/libxineadec/nosefart/nes_apu.c	2005-04-26 17:09:16 +0900
+++ src/libxineadec/nosefart/nes_apu.c	2005-05-22 00:28:09 +0900
@@ -1011,10 +1011,13 @@
          accum = -0x8000;
 
       /* signed 16-bit output, unsigned 8-bit */
-      if (16 == apu->sample_bits)
-         *((int16 *) buffer)++ = (int16) accum;
-      else
-         *((uint8 *) buffer)++ = (accum >> 8) ^ 0x80;
+      if (16 == apu->sample_bits) {
+         *((int16 *) buffer) = (int16) accum;
+         buffer = ((int16 *) buffer) + 1;
+      } else {
+         *((uint8 *) buffer) = (accum >> 8) ^ 0x80;
+         buffer = ((uint8 *) buffer) + 1;
+      }
    }
 
    /* resync cycle counter */
--- ../xine-lib-1.0.1-orig/src/post/audio/stretch.c	2005-04-26 17:09:10 +0900
+++ src/post/audio/stretch.c	2005-05-22 00:32:31 +0900
@@ -476,7 +476,7 @@
     memcpy( outbuf->mem, data_out, 
             outbuf->num_frames * this->bytes_per_frame );
     num_frames_out -= outbuf->num_frames;
-    (uint8_t *)data_out += outbuf->num_frames * this->bytes_per_frame;
+    data_out = (uint8_t *)data_out + outbuf->num_frames * this->bytes_per_frame;
                 
     outbuf->vpts        = this->pts;
     this->pts           = 0;
@@ -587,7 +587,7 @@
     memcpy( (uint8_t *)this->audiofrag + this->num_frames * this->bytes_per_frame,
             data_in, frames_to_copy * this->bytes_per_frame );
     
-    (uint8_t *)data_in += frames_to_copy * this->bytes_per_frame;
+    data_in = (uint8_t *)data_in + frames_to_copy * this->bytes_per_frame;
     this->num_frames += frames_to_copy;
     buf->num_frames -= frames_to_copy;
 
######## continue GCC 4 fixes (2/2: warnings)
--- ../xine-lib-1.0.1-orig/src/xine-engine/buffer.c	2005-04-26 17:09:12 +0900
+++ src/xine-engine/buffer.c	2005-05-21 23:18:48 +0900
@@ -501,7 +501,7 @@
   fifo_buffer_t *this;
   int            i;
   int            alignment = 2048;
-  char          *multi_buffer = NULL;
+  unsigned char *multi_buffer = NULL;
 
   this = xine_xmalloc (sizeof (fifo_buffer_t));
 
--- ../xine-lib-1.0.1-orig/src/xine-engine/load_plugins.c	2005-04-26 17:09:12 +0900
+++ src/xine-engine/load_plugins.c	2005-05-21 23:20:43 +0900
@@ -60,8 +60,6 @@
 #include "xineutils.h"
 #include "compat.h"
 
-static char *plugin_name;
-
 #if 0
 #if DONT_CATCH_SIGSEGV
 
@@ -70,6 +68,8 @@
 
 #else
 
+static char *plugin_name;
+
 void (*old_segv_handler)(int);
 
 static void segv_handler (int hubba) {
@@ -176,7 +176,7 @@
   node = xine_list_first_content (decoder_list);
   while (node) {
 
-    int *type = ((decoder_info_t *)node->info->special_info)->supported_types;
+    unsigned int *type = ((decoder_info_t *)node->info->special_info)->supported_types;
     int priority = get_decoder_priority(this, node);
 
     lprintf ("mapping decoder %s\n", node->info->id);
--- ../xine-lib-1.0.1-orig/src/xine-engine/broadcaster.c	2005-04-26 17:09:12 +0900
+++ src/xine-engine/broadcaster.c	2005-05-21 23:26:06 +0900
@@ -199,7 +199,7 @@
 static void *manager_loop (void *this_gen) {
   broadcaster_t *this = (broadcaster_t *) this_gen;
   struct sockaddr_in fsin; /* the from address of a client */
-  int  alen;               /* from-address length */
+  unsigned int alen;       /* from-address length */
   fd_set rfds;             /* read file descriptor set */
   fd_set efds;             /* exception descriptor set */
   
--- ../xine-lib-1.0.1-orig/src/video_out/vidix/drivers/pm3_vid.c	2005-04-26 17:09:11 +0900
+++ src/video_out/vidix/drivers/pm3_vid.c	2005-05-21 23:32:26 +0900
@@ -288,7 +288,7 @@
 static void
 pm3_setup_overlay(vidix_playback_t *info)
 {
-    int shrink, zoom;
+    u_int shrink, zoom;
     int format = 0;
     int filter = 0;
     int sw = src_w;
@@ -494,7 +494,7 @@
 {
     u_int size = dma->size;
     u_int pages = (size + page_size-1) / page_size;
-    long baddr[pages];
+    unsigned long baddr[pages];
     u_int i;
     uint32_t dest;
 
--- ../xine-lib-1.0.1-orig/src/video_out/vidix/drivers/unichrome_vid.c	2005-04-26 17:09:10 +0900
+++ src/video_out/vidix/drivers/unichrome_vid.c	2005-05-21 23:35:22 +0900
@@ -195,7 +195,7 @@
  *       See ddover.c, DDOVER_HQVCalcZoomWidth() and DDOver_GetDisplayCount()
  */
 static int uc_ovl_map_hzoom(int sw, int dw,  uint32_t* zoom, uint32_t* mini,
-	int* falign, int* dcount)
+	uint32_t* falign, uint32_t* dcount)
 {
 	uint32_t tmp, sw1, d;
 	int md; // Minify-divider
--- ../xine-lib-1.0.1-orig/src/video_out/vidix/vidixlib.c	2005-04-26 17:09:11 +0900
+++ src/video_out/vidix/vidixlib.c	2005-05-21 23:36:18 +0900
@@ -224,7 +224,7 @@
     unsigned (*ver)(void);
     int (*probe)(int,int);
     unsigned version = 0;
-    unsigned char *arg_sep;
+    char *arg_sep;
     arg_sep = strchr(name,':');
     if(arg_sep) { *arg_sep='\0'; drv_args = &arg_sep[1]; }
     strncpy(drv_name,path,sizeof(drv_name));
--- ../xine-lib-1.0.1-orig/src/video_out/video_out_opengl.c	2005-04-26 17:09:11 +0900
+++ src/video_out/video_out_opengl.c	2005-05-21 23:43:24 +0900
@@ -190,7 +190,7 @@
   int                fprog;
   int                tex_width, tex_height; /* independend of frame */
   /* OpenGL capabilities */
-  const GLubyte     *gl_exts;	/* extension string - NULL if uninitialized */
+  const char        *gl_exts;	/* extension string - NULL if uninitialized */
   int                has_bgra;
   int                has_texobj;            /* TODO: use */
   int                has_fragprog;
@@ -675,7 +675,7 @@
 static int render_help_verify_ext (opengl_driver_t *this, char *ext) {
   int   ret = 0;
   int   l = strlen (ext);
-  const GLubyte *e;
+  const char *e;
   for (e = this->gl_exts; e && *e; e = strchr (e, ' ')) {
     while (isspace (*e))
       e++;
@@ -691,7 +691,7 @@
 }
 
 /* Return the address of a linked function */
-static void *getdladdr(const GLubyte *funcName) {
+static void *getdladdr(const char *funcName) {
 
 #if defined(_WIN32)
   return NULL;
@@ -725,7 +725,7 @@
   return (void*) wglGetProcAddress (funcName);
 
 #else
-  void * (*MYgetProcAddress) (const GLubyte *);
+  void * (*MYgetProcAddress) (const char *);
   void *res;
 
   /* Try to get address of extension via glXGetProcAddress[ARB], if that
@@ -752,7 +752,7 @@
   if (this->gl_exts)
     return;
 
-  this->gl_exts  = glGetString (GL_EXTENSIONS);
+  this->gl_exts  = (const char *) glGetString (GL_EXTENSIONS);
   if (! this->gl_exts) {
     if (++num_tests > 10) {
       fprintf (stderr, "video_out_opengl: Cannot find OpenGL extensions (tried multiple times).\n");
######## end GCC 4 fixes
EOT
NoPatch: <<EOT
--- src/video_out/deinterlace.c.old	2002-08-02 00:26:53 +0900
+++ src/video_out/deinterlace.c	2004-04-14 22:37:42 +0900
@@ -62,8 +62,8 @@
 
   int n;
 
-  uint64_t qwEdgeDetect;
-  uint64_t qwThreshold;
+  volatile uint64_t qwEdgeDetect;
+  volatile uint64_t qwThreshold;
 
   static mmx_t YMask = {ub:{0xff,0,0xff,0,0xff,0,0xff,0}};
   static mmx_t Mask = {ub:{0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
@@ -212,9 +212,9 @@
 
   int n;
 
-  uint64_t qwSpatialTolerance;
-  uint64_t qwTemporalTolerance;
-  uint64_t qwThreshold;
+  volatile uint64_t qwSpatialTolerance;
+  volatile uint64_t qwTemporalTolerance;
+  volatile uint64_t qwThreshold;
 
   static mmx_t YMask = {ub:{0xff,0,0xff,0,0xff,0,0xff,0}};
   static mmx_t Mask = {ub:{0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe}};
EOT

/pkg/xine-lib/
/usr/bin/xine-config
/usr/lib/pkgconfig/libxine.pc
/usr/man/man1/xine-config.1.gz
/usr/man/man3/ao_driver_t.3.gz
/usr/man/man3/ao_functions_t.3.gz
/usr/man/man3/audio_cap.3.gz
/usr/man/man3/audio_group.3.gz
/usr/man/man3/audio_prop.3.gz
/usr/man/man3/autoplay_group.3.gz
/usr/man/man3/browse_group.3.gz
/usr/man/man3/build_info.3.gz
/usr/man/man3/cfg_data_t.3.gz
/usr/man/man3/config_group.3.gz
/usr/man/man3/config_values_s.3.gz
/usr/man/man3/config_values_t.3.gz
/usr/man/man3/demux_strategy.3.gz
/usr/man/man3/event_group.3.gz
/usr/man/man3/loadplugins_group.3.gz
/usr/man/man3/mrl_t.3.gz
/usr/man/man3/mrl_types.3.gz
/usr/man/man3/status_group.3.gz
/usr/man/man3/ui_callbacks.3.gz
/usr/man/man3/version_group.3.gz
/usr/man/man3/video_cap.3.gz
/usr/man/man3/video_group.3.gz
/usr/man/man3/video_prop.3.gz
/usr/man/man3/video_ratio.3.gz
/usr/man/man3/visual_types.3.gz
/usr/man/man3/vo_driver_s.3.gz
/usr/man/man3/vo_driver_t.3.gz
/usr/man/man3/vo_frame_t.3.gz
/usr/man/man3/vo_overlay_t.3.gz
/usr/man/man3/xine-lib.3.gz
/usr/man/man3/xine.h.3.gz
/usr/man/man3/xine_api.3.gz
/usr/man/man3/xine_init.3.gz
/usr/man/man3/xine_management.3.gz
/usr/man/man3/xine_t.3.gz
/usr/man/man3/xine_version.3.gz
