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

Commit 3d0965ba authored by Hiroshi Takekawa's avatar Hiroshi Takekawa Committed by Patrick Jacques
Browse files

StagefrightMediaScanner: Call endFile() for MIDI and OGG files.

addStringTag() caches non-ascii metadata strings for later
processing, and then endFile() will be called at the end of
processFile() to convert non-ascii strings from locale's charset
to utf-8 if required.

Stagefright's processFile() failed to call endFile() when the
processing file is a MIDI file or an OGG file.  This patch fixes
this problem to populate metadata correctly.

Added FLAC to the list to help with CM issue #2002

Change-Id: I072e79d81dce1fec63297d2b5d2b870a72e5b66e
parent dc4b5a6e
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -236,6 +236,7 @@ status_t StagefrightMediaScanner::processFile(
        return UNKNOWN_ERROR;
    }

    status_t status;
    if (!strcasecmp(extension, ".mid")
            || !strcasecmp(extension, ".smf")
            || !strcasecmp(extension, ".imy")
@@ -244,15 +245,24 @@ status_t StagefrightMediaScanner::processFile(
            || !strcasecmp(extension, ".rtttl")
            || !strcasecmp(extension, ".rtx")
            || !strcasecmp(extension, ".ota")) {
        return HandleMIDI(path, &client);
        status = HandleMIDI(path, &client);
        if (status != OK)
            return status;
        goto endfile;
    }

    if (!strcasecmp(extension, ".ogg")) {
        return HandleOGG(path, &client);
        status = HandleOGG(path, &client);
        if (status != OK)
            return status;
        goto endfile;
    }

    if (!strcasecmp(extension, ".flac")) {
        return HandleFLAC(path, &client);
        status = HandleFLAC(path, &client);
        if (status != OK)
            return status;
        goto endfile;
    }

    if (mRetriever->setDataSource(path) == OK
@@ -290,7 +300,7 @@ status_t StagefrightMediaScanner::processFile(
            }
        }
    }

 endfile:
    client.endFile();

    return OK;