Skip to content

Commit dc1a26e

Browse files
committed
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. Reviewed by: Brad Fitzpatrick, Marco Nelissen. Change-Id: I072e79d81dce1fec63297d2b5d2b870a72e5b66e
1 parent 14ac954 commit dc1a26e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

media/libstagefright/StagefrightMediaScanner.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,16 @@ status_t StagefrightMediaScanner::processFile(
172172
|| !strcasecmp(extension, ".rtttl")
173173
|| !strcasecmp(extension, ".rtx")
174174
|| !strcasecmp(extension, ".ota")) {
175-
return HandleMIDI(path, &client);
176-
}
177-
178-
if (!strcasecmp(extension, ".ogg")) {
179-
return HandleOGG(path, &client);
180-
}
181-
182-
if (mRetriever->setDataSource(path) == OK
175+
status_t status = HandleMIDI(path, &client);
176+
if (status != OK) {
177+
return status;
178+
}
179+
} else if (!strcasecmp(extension, ".ogg")) {
180+
status_t status = HandleOGG(path, &client);
181+
if (status != OK) {
182+
return status;
183+
}
184+
} else if (mRetriever->setDataSource(path) == OK
183185
&& mRetriever->setMode(
184186
METADATA_MODE_METADATA_RETRIEVAL_ONLY) == OK) {
185187
const char *value;

0 commit comments

Comments
 (0)