コード例 #1
0
ファイル: bdj.c プロジェクト: ShiftMediaProject/libbluray
static const char *_bdj_buda_root(BDJ_STORAGE *storage)
{
    const char *root;
    char       *cache_home;

    if (storage->no_persistent_storage) {
        return NULL;
    }

    if (!storage->cache_root) {

        root = getenv("LIBBLURAY_CACHE_ROOT");
        if (root) {
            return root;
        }

        cache_home = file_get_cache_home();
        if (cache_home) {
            storage->cache_root = str_printf("%s" DIR_SEP "bluray" DIR_SEP "bluray.bindingunit.root" DIR_SEP, cache_home);
            X_FREE(cache_home);
            BD_DEBUG(DBG_BDJ, "LIBBLURAY_CACHE_ROOT not set, using %s\n", storage->cache_root);
        }

        if (!storage->cache_root) {
            BD_DEBUG(DBG_BDJ | DBG_CRIT, "WARNING: BD-J cache root not set\n");
        }
    }

    return storage->cache_root;
}
コード例 #2
0
ファイル: bdj.c プロジェクト: ggervasio/mythtv
static const char *_bdj_buda_root(BDJ_STORAGE *storage)
{
    const char *root;
    char       *cache_home;

    if (!storage->cache_root) {

        root = getenv("LIBBLURAY_CACHE_ROOT");
        if (root) {
            return root;
        }

        cache_home = file_get_cache_home();
        storage->cache_root = str_printf("%s" DIR_SEP "bluray" DIR_SEP "bluray.bindingunit.root" DIR_SEP, cache_home ? cache_home : "");
        X_FREE(cache_home);

        BD_DEBUG(DBG_BDJ, "LIBBLURAY_CACHE_ROOT not set, using %s\n", storage->cache_root);
    }

    return storage->cache_root;
}