diff options
author | Chong Zhang <chz@google.com> | 2014-08-14 21:17:50 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-14 19:49:28 +0000 |
commit | 261562316c1b652ea697c99c0f24a54112bd0385 (patch) | |
tree | 3317a4805ddb234ecc196ca3fcc574fb4783a8e4 /media | |
parent | 44a5a202101614302f607228d4357496b350bab4 (diff) | |
parent | 7b3cd1f33dcfc0b6034144cf48c0919cf7ca6046 (diff) | |
download | frameworks_av-261562316c1b652ea697c99c0f24a54112bd0385.zip frameworks_av-261562316c1b652ea697c99c0f24a54112bd0385.tar.gz frameworks_av-261562316c1b652ea697c99c0f24a54112bd0385.tar.bz2 |
Merge "make NuPlayer's http connection mechanism behave more like that of AwesomePlayer's" into lmp-dev
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/DataSource.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/media/libstagefright/DataSource.cpp b/media/libstagefright/DataSource.cpp index 908cdca..008da5a 100644 --- a/media/libstagefright/DataSource.cpp +++ b/media/libstagefright/DataSource.cpp @@ -209,25 +209,29 @@ sp<DataSource> DataSource::CreateFromURI( uri = tmp.string(); } - if (httpSource->connect(uri, headers) != OK) { + String8 cacheConfig; + bool disconnectAtHighwatermark; + KeyedVector<String8, String8> nonCacheSpecificHeaders; + if (headers != NULL) { + nonCacheSpecificHeaders = *headers; + NuCachedSource2::RemoveCacheSpecificHeaders( + &nonCacheSpecificHeaders, + &cacheConfig, + &disconnectAtHighwatermark); + } + + if (httpSource->connect(uri, &nonCacheSpecificHeaders) != OK) { ALOGE("Failed to connect http source!"); return NULL; } if (!isWidevine) { - String8 cacheConfig; - bool disconnectAtHighwatermark; - if (headers != NULL) { - KeyedVector<String8, String8> copy = *headers; - NuCachedSource2::RemoveCacheSpecificHeaders( - ©, &cacheConfig, &disconnectAtHighwatermark); - } + String8 contentType = httpSource->getMIMEType(); sp<NuCachedSource2> cachedSource = new NuCachedSource2( httpSource, - cacheConfig.isEmpty() ? NULL : cacheConfig.string()); - - String8 contentType = httpSource->getMIMEType(); + cacheConfig.isEmpty() ? NULL : cacheConfig.string(), + disconnectAtHighwatermark); if (strncasecmp(contentType.string(), "audio/", 6)) { // We're not doing this for streams that appear to be audio-only |