Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 680bcddf authored by Chong Zhang's avatar Chong Zhang Committed by android-build-merger
Browse files

Merge "Log fatal error when c2 sw codec fails to load" into qt-dev am: ca45d6b3

am: 5972bcd1

Change-Id: Ia2ce530988554803c15a364f6c6af2bd526dfedf
parents 829942a7 5972bcd1
Loading
Loading
Loading
Loading
+19 −16
Original line number Diff line number Diff line
@@ -661,15 +661,18 @@ c2_status_t C2PlatformComponentStore::ComponentModule::init(
    ALOGV("in %s", __func__);
    ALOGV("loading dll");
    mLibHandle = dlopen(libPath.c_str(), RTLD_NOW|RTLD_NODELETE);
    if (mLibHandle == nullptr) {
        // could be access/symbol or simply not being there
        ALOGD("could not dlopen %s: %s", libPath.c_str(), dlerror());
        mInit = C2_CORRUPTED;
    } else {
    LOG_ALWAYS_FATAL_IF(mLibHandle == nullptr,
            "could not dlopen %s: %s", libPath.c_str(), dlerror());

    createFactory =
        (C2ComponentFactory::CreateCodec2FactoryFunc)dlsym(mLibHandle, "CreateCodec2Factory");
    LOG_ALWAYS_FATAL_IF(createFactory == nullptr,
            "createFactory is null in %s", libPath.c_str());

    destroyFactory =
        (C2ComponentFactory::DestroyCodec2FactoryFunc)dlsym(mLibHandle, "DestroyCodec2Factory");
    LOG_ALWAYS_FATAL_IF(destroyFactory == nullptr,
            "destroyFactory is null in %s", libPath.c_str());

    mComponentFactory = createFactory();
    if (mComponentFactory == nullptr) {
@@ -678,7 +681,7 @@ c2_status_t C2PlatformComponentStore::ComponentModule::init(
    } else {
        mInit = C2_OK;
    }
    }

    if (mInit != C2_OK) {
        return mInit;
    }