예제 #1
0
파일: config.cpp 프로젝트: gilles/mongo
 bool DBConfig::load(){
     scoped_lock lk( _lock );
     return _load();
 }
예제 #2
0
파일: Image.cpp 프로젝트: meh2481/pony48
void Image::_reload()
{
	_load(m_sFilename);
}
예제 #3
0
int libaacs_open(BD_AACS *p, const char *device,
                   void *file_open_handle, void *file_open_fp,
                   const char *keyfile_path)

{
    int error_code = 0;

    fptr_p_void open;
    fptr_p_void open2;
    fptr_p_void init;
    fptr_int    open_device;
    fptr_int    aacs_get_mkb_version;
    fptr_p_void aacs_get_disc_id;

    _libaacs_close(p);

    *(void **)(&open)  = dl_dlsym(p->h_libaacs, "aacs_open");
    *(void **)(&open2) = dl_dlsym(p->h_libaacs, "aacs_open2");
    *(void **)(&init)  = dl_dlsym(p->h_libaacs, "aacs_init");
    *(void **)(&aacs_get_mkb_version) = dl_dlsym(p->h_libaacs, "aacs_get_mkb_version");
    *(void **)(&aacs_get_disc_id)     = dl_dlsym(p->h_libaacs, "aacs_get_disc_id");
    *(void **)(&open_device)          = dl_dlsym(p->h_libaacs, "aacs_open_device");

    if (init && open_device) {
        p->aacs = init();
        DL_CALL(p->h_libaacs, aacs_set_fopen, p->aacs, file_open_handle, file_open_fp);
        error_code = open_device(p->aacs, device, keyfile_path);
    } else if (open2) {
        BD_DEBUG(DBG_BLURAY, "Using old aacs_open2(), no UDF support available\n");
        p->aacs = open2(device, keyfile_path, &error_code);

        /* libmmbd needs dev: for devices */
        if (!p->aacs && p->impl_id == IMPL_LIBMMBD && !strncmp(device, "/dev/", 5)) {
            char *tmp_device = str_printf("dev:%s", device);
            if (tmp_device) {
                p->aacs = open2(tmp_device, keyfile_path, &error_code);
                X_FREE(tmp_device);
            }
        }
    } else if (open) {
        BD_DEBUG(DBG_BLURAY, "Using old aacs_open(), no verbose error reporting available\n");
        p->aacs = open(device, keyfile_path);
    } else {
        BD_DEBUG(DBG_BLURAY, "aacs_open() not found\n");
    }

    if (error_code) {
        /* failed. try next aacs implementation if available. */
        BD_AACS *p2 = _load(p->impl_id + 1);
        if (p2) {
            if (!libaacs_open(p2, device, file_open_handle, file_open_fp, keyfile_path)) {
                /* succeed - swap implementations */
                _unload(p);
                *p = *p2;
                X_FREE(p2);
                return 0;
            }
            /* failed - report original errors */
            libaacs_unload(&p2);
        }
    }

    if (p->aacs) {
        if (aacs_get_mkb_version) {
            p->mkbv = aacs_get_mkb_version(p->aacs);
        }
        if (aacs_get_disc_id) {
            p->disc_id = (const uint8_t *)aacs_get_disc_id(p->aacs);
        }
        return error_code;
    }

    return error_code ? error_code : 1;
}
예제 #4
0
파일: Image.cpp 프로젝트: meh2481/pony48
Image::Image(string sFilename)
{
	m_sFilename = sFilename;
	_load(sFilename);
	_addImgReload(this);
}
예제 #5
0
BD_AACS *libaacs_load(int force_mmbd)
{
    return _load(force_mmbd ? IMPL_LIBMMBD : 0);
}