Origin: upstream, other, *
Description: Applied patches. See Vcs-* headers in debian/control.

--- xine-lib-1.1.20.1.orig/misc/xine-fontconv.c
+++ xine-lib-1.1.20.1/misc/xine-fontconv.c
@@ -109,7 +109,7 @@ osd_fontchar_t fontchar;
 osd_font_t     font;
 
 
-static int gzwrite_i16(gzFile *fp, uint16_t number) {
+static int gzwrite_i16(gzFile fp, uint16_t number) {
   return gzputc(fp, number & 0xFF) != -1 &&
          gzputc(fp, (number >> 8) & 0xFF) != -1;
 }
@@ -341,7 +341,7 @@ void render_font (FT_Face face, char *fo
 
   char                filename[1024];
   FT_Bitmap          *out_bitmap;
-  gzFile             *fp;
+  gzFile              fp;
   int                 error;
   int                 error_counter;
   int                 glyph_index;
--- xine-lib-1.1.20.1.orig/misc/xine-list.c
+++ xine-lib-1.1.20.1/misc/xine-list.c
@@ -107,6 +107,16 @@ to the extent permitted by law.\n",
     return 0;
 
   xine_t *xine = xine_new ();
+
+  /* Avoid writing catalog.cache if possible */
+  int major, minor, sub;
+  xine_get_version (&major, &minor, &sub);
+  if ((major == 1 && minor == 1 && sub > 20) ||
+      (major == 1 && minor == 2 && sub > 0) ||
+      (major == 1 && minor > 2) ||
+      (major > 1))
+    xine_set_flags (xine, XINE_FLAG_NO_WRITE_CACHE);
+
   xine_init (xine);
 
   char *text = NULL;
--- xine-lib-1.1.20.1.orig/include/xine.h.in
+++ xine-lib-1.1.20.1/include/xine.h.in
@@ -134,6 +134,12 @@ int  xine_check_version (int major, int
  */
 xine_t *xine_new (void) XINE_PROTECTED;
 
+/* allow the setting of some flags before xine_init
+ * FIXME-ABI: this is currently GLOBAL
+ */
+void xine_set_flags (xine_t *, int) XINE_PROTECTED __attribute__((weak));
+#define XINE_FLAG_NO_WRITE_CACHE		1
+
 /*
  * post_init the xine engine
  */
--- xine-lib-1.1.20.1.orig/src/xine-engine/xine.c
+++ xine-lib-1.1.20.1/src/xine-engine/xine.c
@@ -78,6 +78,10 @@
 #endif /* WIN32 */
 
 
+/* FIXME-ABI Global variable. Done this way for ABI & API reasons... */
+int _x_flags = 0;
+
+
 static void mutex_cleanup (void *mutex) {
   pthread_mutex_unlock ((pthread_mutex_t *) mutex);
 }
@@ -1695,6 +1699,12 @@ static void config_save_cb (void *this_g
   this->save_path = entry->str_value;
 }
 
+void xine_set_flags (xine_t *this, int flags)
+{
+  this = this; /* FIXME-ABI: one day, these will be in xine_t...? */
+  _x_flags = flags;
+}
+
 void xine_init (xine_t *this) {
   static const char *demux_strategies[] = {"default", "reverse", "content",
 					   "extension", NULL};
--- xine-lib-1.1.20.1.orig/src/xine-engine/osd.c
+++ xine-lib-1.1.20.1/src/xine-engine/osd.c
@@ -650,7 +650,7 @@ static void osd_set_position (osd_object
   osd->display_y = y;
 }
 
-static uint16_t gzread_i16(gzFile *fp) {
+static uint16_t gzread_i16(gzFile fp) {
   uint16_t ret;
   ret = gzgetc(fp);
   ret |= (gzgetc(fp)<<8);
@@ -663,7 +663,7 @@ static uint16_t gzread_i16(gzFile *fp) {
 
 static int osd_renderer_load_font(osd_renderer_t *this, char *filename) {
 
-  gzFile      *fp;
+  gzFile       fp;
   osd_font_t  *font = NULL;
   int          i, ret = 0;
 
--- xine-lib-1.1.20.1.orig/src/xine-engine/load_plugins.c
+++ xine-lib-1.1.20.1/src/xine-engine/load_plugins.c
@@ -1201,7 +1201,8 @@ void _x_scan_plugins (xine_t *this) {
   xine_list_delete (plugindirs);
   free(homedir);
 
-  save_catalog (this);
+  if ((_x_flags & XINE_FLAG_NO_WRITE_CACHE) == 0)
+    save_catalog (this);
 
   load_required_plugins (this);
 
--- xine-lib-1.1.20.1.orig/src/xine-engine/xine_internal.h
+++ xine-lib-1.1.20.1/src/xine-engine/xine_internal.h
@@ -123,6 +123,12 @@ struct xine_s {
 #endif
 };
 
+/* FIXME-ABI Some global flag bits */
+/* See xine_set_flags() */
+#ifdef XINE_ENGINE_INTERNAL
+extern int _x_flags XINE_PROTECTED;
+#endif
+
 /*
  * xine thread tickets
  */
