[farsight2/master] Move the cache into the XDG cache dir

Olivier Crête olivier.crete at collabora.co.uk
Wed Feb 18 10:47:36 PST 2009


---
 gst/fsrtpconference/fs-rtp-codec-cache.c |    4 ++--
 tests/check/Makefile.am                  |    4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-codec-cache.c b/gst/fsrtpconference/fs-rtp-codec-cache.c
index bb40e26..d4774d8 100644
--- a/gst/fsrtpconference/fs-rtp-codec-cache.c
+++ b/gst/fsrtpconference/fs-rtp-codec-cache.c
@@ -99,13 +99,13 @@ get_codecs_cache_path (FsMediaType media_type) {
   if (media_type == FS_MEDIA_TYPE_AUDIO) {
     cache_path = g_strdup (g_getenv ("FS_AUDIO_CODECS_CACHE"));
     if (cache_path == NULL) {
-      cache_path = g_build_filename (g_get_home_dir (), ".farsight",
+      cache_path = g_build_filename (g_get_user_cache_dir (), "farsight",
           "codecs.audio." HOST_CPU ".cache", NULL);
     }
   } else if (media_type == FS_MEDIA_TYPE_VIDEO) {
     cache_path = g_strdup (g_getenv ("FS_VIDEO_CODECS_CACHE"));
     if (cache_path == NULL) {
-      cache_path = g_build_filename (g_get_home_dir (), ".farsight",
+      cache_path = g_build_filename (g_get_user_cache_dir (), "farsight",
           "codecs.video." HOST_CPU ".cache", NULL);
     }
   } else {
diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am
index bc2f1a8..05c219d 100644
--- a/tests/check/Makefile.am
+++ b/tests/check/Makefile.am
@@ -13,13 +13,15 @@ TESTS_ENVIRONMENT = \
 	FS_PLUGIN_PATH=$(top_builddir)/transmitters/rawudp/.libs:$(top_builddir)/transmitters/multicast/.libs:$(top_builddir)/transmitters/nice/.libs \
 	LD_LIBRARY_PATH=$(top_builddir)/gst-libs/gst/farsight/.libs:${LD_LIBRARY_PATH} \
 	UPNP_XML_PATH=$(srcdir)/upnp \
-	SRCDIR=$(srcdir)
+	SRCDIR=$(srcdir) \
+	XDG_CACHE_HOME=$(builddir)/cache
 
 
 # ths core dumps of some machines have PIDs appended
 CLEANFILES = core* test-registry.xml
 
 clean-local: clean-local-check
+	rm -rf cache
 
 $(CHECK_REGISTRY):
 	$(TESTS_ENVIRONMENT)
-- 
1.5.6.5



More information about the farsight-commits mailing list