Fix compilation errors in libmedia, libstagefright.
(invalid conversion from 'const char*' to 'char*') Change-Id: Idef85606b7cff629b2778ed8134c79c892af54c2
This commit is contained in:
@@ -77,13 +77,13 @@ status_t MediaScanner::processDirectory(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool fileMatchesExtension(const char* path, const char* extensions) {
|
static bool fileMatchesExtension(const char* path, const char* extensions) {
|
||||||
char* extension = strrchr(path, '.');
|
const char* extension = strrchr(path, '.');
|
||||||
if (!extension) return false;
|
if (!extension) return false;
|
||||||
++extension; // skip the dot
|
++extension; // skip the dot
|
||||||
if (extension[0] == 0) return false;
|
if (extension[0] == 0) return false;
|
||||||
|
|
||||||
while (extensions[0]) {
|
while (extensions[0]) {
|
||||||
char* comma = strchr(extensions, ',');
|
const char* comma = strchr(extensions, ',');
|
||||||
size_t length = (comma ? comma - extensions : strlen(extensions));
|
size_t length = (comma ? comma - extensions : strlen(extensions));
|
||||||
if (length == strlen(extension) && strncasecmp(extension, extensions, length) == 0) return true;
|
if (length == strlen(extension) && strncasecmp(extension, extensions, length) == 0) return true;
|
||||||
extensions += length;
|
extensions += length;
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ HTTPDataSource::HTTPDataSource(
|
|||||||
string path;
|
string path;
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
char *slash = strchr(uri + 7, '/');
|
const char *slash = strchr(uri + 7, '/');
|
||||||
if (slash == NULL) {
|
if (slash == NULL) {
|
||||||
host = uri + 7;
|
host = uri + 7;
|
||||||
path = "/";
|
path = "/";
|
||||||
@@ -167,7 +167,7 @@ HTTPDataSource::HTTPDataSource(
|
|||||||
path = slash;
|
path = slash;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *colon = strchr(host.c_str(), ':');
|
const char *colon = strchr(host.c_str(), ':');
|
||||||
if (colon == NULL) {
|
if (colon == NULL) {
|
||||||
port = 80;
|
port = 80;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user