Loading media/libmedia/MediaScannerClient.cpp +39 −35 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ void MediaScannerClient::beginFile() bool MediaScannerClient::addStringTag(const char* name, const char* value) { if (mLocaleEncoding != kEncodingNone) { // don't bother caching strings that are all ASCII. // call handleStringTag directly instead. // check to see if value (which should be utf8) has any non-ASCII characters Loading @@ -85,7 +84,6 @@ bool MediaScannerClient::addStringTag(const char* name, const char* value) return true; } // else fall through } // autodetection is not necessary, so no need to cache the values // pass directly to the client instead Loading Loading @@ -198,7 +196,6 @@ void MediaScannerClient::convertValues(uint32_t encoding) void MediaScannerClient::endFile() { if (mLocaleEncoding != kEncodingNone) { int size = mNames->size(); uint32_t encoding = kEncodingAll; Loading @@ -206,16 +203,23 @@ void MediaScannerClient::endFile() for (int i = 0; i < mNames->size(); i++) encoding &= possibleEncodings(mValues->getEntry(i)); // if the locale encoding matches, then assume we have a native encoding. // If one of the possible encodings matches the locale encoding, use that. // Otherwise, if there is only one possible encoding, use that. if (encoding & mLocaleEncoding) convertValues(mLocaleEncoding); else if ((encoding & (encoding - 1)) == 0) convertValues(encoding); else { // TODO: try harder to disambiguate the encoding, perhaps by looking at // other files by same artist, or even the user's entire collection. // For now, fall through and insert the strings as they are. } // finally, push all name/value pairs to the client for (int i = 0; i < mNames->size(); i++) { if (!handleStringTag(mNames->getEntry(i), mValues->getEntry(i))) break; } } // else addStringTag() has done all the work so we have nothing to do delete mNames; Loading Loading
media/libmedia/MediaScannerClient.cpp +39 −35 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ void MediaScannerClient::beginFile() bool MediaScannerClient::addStringTag(const char* name, const char* value) { if (mLocaleEncoding != kEncodingNone) { // don't bother caching strings that are all ASCII. // call handleStringTag directly instead. // check to see if value (which should be utf8) has any non-ASCII characters Loading @@ -85,7 +84,6 @@ bool MediaScannerClient::addStringTag(const char* name, const char* value) return true; } // else fall through } // autodetection is not necessary, so no need to cache the values // pass directly to the client instead Loading Loading @@ -198,7 +196,6 @@ void MediaScannerClient::convertValues(uint32_t encoding) void MediaScannerClient::endFile() { if (mLocaleEncoding != kEncodingNone) { int size = mNames->size(); uint32_t encoding = kEncodingAll; Loading @@ -206,16 +203,23 @@ void MediaScannerClient::endFile() for (int i = 0; i < mNames->size(); i++) encoding &= possibleEncodings(mValues->getEntry(i)); // if the locale encoding matches, then assume we have a native encoding. // If one of the possible encodings matches the locale encoding, use that. // Otherwise, if there is only one possible encoding, use that. if (encoding & mLocaleEncoding) convertValues(mLocaleEncoding); else if ((encoding & (encoding - 1)) == 0) convertValues(encoding); else { // TODO: try harder to disambiguate the encoding, perhaps by looking at // other files by same artist, or even the user's entire collection. // For now, fall through and insert the strings as they are. } // finally, push all name/value pairs to the client for (int i = 0; i < mNames->size(); i++) { if (!handleStringTag(mNames->getEntry(i), mValues->getEntry(i))) break; } } // else addStringTag() has done all the work so we have nothing to do delete mNames; Loading