summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-03-17 16:38:30 -0700
committerAndreas Huber <andih@google.com>2010-03-17 16:38:30 -0700
commit0887d170c7dc57411855382e326dd471824c9c02 (patch)
treee8b9c0ca0e7fad71bba8f6e947c5368fbc412d3e /include/media
parent72d747da6672c68bc82e05912bf57d4e2bac2c3c (diff)
downloadframeworks_av-0887d170c7dc57411855382e326dd471824c9c02.zip
frameworks_av-0887d170c7dc57411855382e326dd471824c9c02.tar.gz
frameworks_av-0887d170c7dc57411855382e326dd471824c9c02.tar.bz2
While streaming media data, upon a socket-read error, try reconnecting to the server and attempt to re-read for at most 3 times.
Change-Id: I7534905e07a6456d18b26d5d60fa8915f25ae99e related-to-bug: 2492187
Diffstat (limited to 'include/media')
-rw-r--r--include/media/stagefright/HTTPDataSource.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/media/stagefright/HTTPDataSource.h b/include/media/stagefright/HTTPDataSource.h
index b6176eb..b5d1e7a 100644
--- a/include/media/stagefright/HTTPDataSource.h
+++ b/include/media/stagefright/HTTPDataSource.h
@@ -54,7 +54,11 @@ protected:
private:
enum {
- kBufferSize = 32 * 1024
+ kBufferSize = 32 * 1024,
+
+ // If we encounter a socket-read error we'll try reconnecting
+ // and restarting the read for at most this many times.
+ kMaxNumRetries = 3,
};
enum State {
@@ -84,6 +88,8 @@ private:
bool mContentLengthValid;
unsigned long long mContentLength;
+ int32_t mNumRetriesLeft;
+
void init(const KeyedVector<String8, String8> *headers);
ssize_t sendRangeRequest(size_t offset);