Merge "HTTPDataSource must be connected before it is usable. Fix this in the stagefright tool."

This commit is contained in:
Andreas Huber
2010-03-16 09:11:44 -07:00
committed by Android (Google) Code Review

View File

@ -434,7 +434,11 @@ int main(int argc, char **argv) {
sp<DataSource> dataSource;
if (!strncasecmp("http://", filename, 7)) {
dataSource = new HTTPDataSource(filename);
dataSource = new CachingDataSource(dataSource, 64 * 1024, 10);
if (((HTTPDataSource *)dataSource.get())->connect() != OK) {
fprintf(stderr, "failed to connect to HTTP server.\n");
return -1;
}
dataSource = new CachingDataSource(dataSource, 32 * 1024, 20);
} else {
dataSource = new FileSource(filename);
}