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

Commit 9b48f5d7 authored by Chong Zhang's avatar Chong Zhang
Browse files

disable AwesomePlayer for Ogg vorbis

Bug: 17108024

Change-Id: I0a970e6476d0f739e65d2200d0f5220dee8d36ef
parent 9f0446d8
Loading
Loading
Loading
Loading
+14 −11
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ status_t MediaPlayerFactory::registerFactory_l(IFactory* factory,
    return OK;
}

player_type MediaPlayerFactory::getDefaultPlayerType() {
static player_type getDefaultPlayerType() {
    char value[PROPERTY_VALUE_MAX];
    if (property_get("media.stagefright.use-awesome", value, NULL)
            && (!strcmp("1", value) || !strcasecmp("true", value))) {
@@ -181,6 +181,8 @@ class StagefrightPlayerFactory :
                               int64_t offset,
                               int64_t /*length*/,
                               float /*curScore*/) {
        if (getDefaultPlayerType()
                == STAGEFRIGHT_PLAYER) {
            char buf[20];
            lseek(fd, offset, SEEK_SET);
            read(fd, buf, sizeof(buf));
@@ -191,6 +193,7 @@ class StagefrightPlayerFactory :
            // Ogg vorbis?
            if (ident == 0x5367674f) // 'OggS'
                return 1.0;
        }

        return 0.0;
    }
+0 −1
Original line number Diff line number Diff line
@@ -71,7 +71,6 @@ class MediaPlayerFactory {

    static status_t registerFactory_l(IFactory* factory,
                                      player_type type);
    static player_type getDefaultPlayerType();

    static Mutex       sLock;
    static tFactoryMap sFactoryMap;