summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive/LiveSession.cpp
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2015-02-04 11:32:50 -0800
committerRobert Shih <robertshih@google.com>2015-02-04 11:35:58 -0800
commitafcc4fcbb3a094ec2221d6e523772e76894d1f00 (patch)
tree17fb4099411647b0e1a3172fcba63b4a280e4d89 /media/libstagefright/httplive/LiveSession.cpp
parent1bf8a21018cc1d95dc3c28b5044aeda327c7b54e (diff)
downloadframeworks_av-afcc4fcbb3a094ec2221d6e523772e76894d1f00.zip
frameworks_av-afcc4fcbb3a094ec2221d6e523772e76894d1f00.tar.gz
frameworks_av-afcc4fcbb3a094ec2221d6e523772e76894d1f00.tar.bz2
httplive: Set start time and segment start time in conjunction.
Also add comments describing how start time and segment start time are used. Based on AOSP CL https://android-review.googlesource.com/127653 by Joakim Johansson <joakim.c.johansson@sonymobile.com> but uses the lowest segment start time instead of highest. Bug: 18821145 Change-Id: I14cf1186d0daf517a24e8423c3a708b4c9ba06c4
Diffstat (limited to 'media/libstagefright/httplive/LiveSession.cpp')
-rw-r--r--media/libstagefright/httplive/LiveSession.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index 9daab3b..ead54ef 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -1509,14 +1509,15 @@ void LiveSession::onChangeConfiguration3(const sp<AMessage> &msg) {
if (meta != NULL && !meta->findInt32("discontinuity", &type)) {
int64_t tmpUs;
+ int64_t tmpSegmentUs;
+
CHECK(meta->findInt64("timeUs", &tmpUs));
- if (startTimeUs < 0 || tmpUs < startTimeUs) {
+ CHECK(meta->findInt64("segmentStartTimeUs", &tmpSegmentUs));
+ if (startTimeUs < 0 || tmpSegmentUs < segmentStartTimeUs) {
+ startTimeUs = tmpUs;
+ segmentStartTimeUs = tmpSegmentUs;
+ } else if (tmpSegmentUs == segmentStartTimeUs && tmpUs < startTimeUs) {
startTimeUs = tmpUs;
- }
-
- CHECK(meta->findInt64("segmentStartTimeUs", &tmpUs));
- if (segmentStartTimeUs < 0 || tmpUs < segmentStartTimeUs) {
- segmentStartTimeUs = tmpUs;
}
int32_t seq;