Loading media/libmedia/MediaScannerClient.cpp +31 −12 Original line number Diff line number Diff line Loading @@ -200,14 +200,32 @@ void MediaScannerClient::endFile() { if (mLocaleEncoding != kEncodingNone) { int size = mNames->size(); uint32_t encoding = kEncodingAll; uint32_t tmpEnc; uint32_t encodings = kEncodingAll; // guess proper encoding for non-ASCII values int i = 0; while (mNames->getEntry(i) != NULL) { tmpEnc = possibleEncodings(mValues->getEntry(i)); if (mLocaleEncoding == kEncodingEUCKR && tmpEnc == kEncodingNone) { // there are some Korean mp3s which use EUC-KR and utf-8 together in their tag // this case means the value's encoding is utf-8. so, don't count them if (!handleStringTag(mNames->getEntry(i), mValues->getEntry(i))) break; mNames->erase(i); mValues->erase(i); } else { // to find more accurate encoding, // compute a bit mask containing all possible encodings for (int i = 0; i < mNames->size(); i++) encoding &= possibleEncodings(mValues->getEntry(i)); encodings &= tmpEnc; i += 1; } } // if the locale encoding matches, then assume we have a native encoding. if (encoding & mLocaleEncoding) if (mNames->size() > 0) { // if the locale encoding matches, then assume we have a native encoding if (encodings & mLocaleEncoding) convertValues(mLocaleEncoding); // finally, push all name/value pairs to the client Loading @@ -216,6 +234,7 @@ void MediaScannerClient::endFile() break; } } } // else addStringTag() has done all the work so we have nothing to do delete mNames; Loading Loading
media/libmedia/MediaScannerClient.cpp +31 −12 Original line number Diff line number Diff line Loading @@ -200,14 +200,32 @@ void MediaScannerClient::endFile() { if (mLocaleEncoding != kEncodingNone) { int size = mNames->size(); uint32_t encoding = kEncodingAll; uint32_t tmpEnc; uint32_t encodings = kEncodingAll; // guess proper encoding for non-ASCII values int i = 0; while (mNames->getEntry(i) != NULL) { tmpEnc = possibleEncodings(mValues->getEntry(i)); if (mLocaleEncoding == kEncodingEUCKR && tmpEnc == kEncodingNone) { // there are some Korean mp3s which use EUC-KR and utf-8 together in their tag // this case means the value's encoding is utf-8. so, don't count them if (!handleStringTag(mNames->getEntry(i), mValues->getEntry(i))) break; mNames->erase(i); mValues->erase(i); } else { // to find more accurate encoding, // compute a bit mask containing all possible encodings for (int i = 0; i < mNames->size(); i++) encoding &= possibleEncodings(mValues->getEntry(i)); encodings &= tmpEnc; i += 1; } } // if the locale encoding matches, then assume we have a native encoding. if (encoding & mLocaleEncoding) if (mNames->size() > 0) { // if the locale encoding matches, then assume we have a native encoding if (encodings & mLocaleEncoding) convertValues(mLocaleEncoding); // finally, push all name/value pairs to the client Loading @@ -216,6 +234,7 @@ void MediaScannerClient::endFile() break; } } } // else addStringTag() has done all the work so we have nothing to do delete mNames; Loading