From: Darren S. <li...@yo...> - 2012-01-18 21:48:45
|
# HG changeset patch # User Darren Salt <li...@yo...> # Date 1326923309 0 # Node ID bf11a89151047b53740f6e7502c99d4acfc9665d # Branch default # Parent f946e7f3be6e9b95c087aef0dddf466de63640f8 Hack to avoid xine-list-* causing catalog.cache to be written. diff --git a/misc/xine-list.c b/misc/xine-list.c --- a/misc/xine-list.c +++ b/misc/xine-list.c @@ -107,6 +107,16 @@ 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; --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1201,7 +1201,8 @@ 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); --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c --- a/src/xine-engine/xine.c +++ b/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 @@ 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}; --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.h @@ -123,6 +123,12 @@ #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 */ |