OSDN Git Service

Fix bug in use of getPositionUsec()
authorGlenn Kasten <gkasten@google.com>
Fri, 6 Jan 2012 20:24:08 +0000 (12:24 -0800)
committerGlenn Kasten <gkasten@google.com>
Fri, 6 Jan 2012 20:28:33 +0000 (12:28 -0800)
getPositionUsec() returns int64_t, not uint32_t, so it would truncate
after 71 minutes.  Also the check ANDROID_UNKNOWN_TIME always failed.

Change-Id: I3152d7715dfe4b67a5fad6985c6717c7a802b464

wilhelm/src/android/android_AudioSfDecoder.cpp

index 5908189..1a50ccb 100644 (file)
@@ -696,7 +696,7 @@ CacheStatus_t AudioSfDecoder::getCacheRemaining(bool *eos) {
 
             //   fill level is ratio of how much has been played + how much is
             //   cached, divided by total duration
-            uint32_t currentPositionUsec = getPositionUsec();
+            int64_t currentPositionUsec = getPositionUsec();
             if (currentPositionUsec == ANDROID_UNKNOWN_TIME) {
                 // if we don't know where we are, assume the worst for the fill ratio
                 currentPositionUsec = 0;