summaryrefslogtreecommitdiffstats
path: root/include
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
commit878342993276a1a98f35f3ccda24c675ed09b7eb (patch)
tree43825eb98a236d4891db14a2d592e3839d961f46 /include
parentd246ca811575eee9122070648e93b7484f6edd81 (diff)
downloadframeworks_base-878342993276a1a98f35f3ccda24c675ed09b7eb.zip
frameworks_base-878342993276a1a98f35f3ccda24c675ed09b7eb.tar.gz
frameworks_base-878342993276a1a98f35f3ccda24c675ed09b7eb.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')
-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);