Merge "audio: fix getFrame overflow after long-term playback" into main am: 3121789c37 am: 72a9c46764

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3503887

Change-Id: I004b78a35bb9aea0301bbe82605d151ce009b282
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/audio/aidl/default/include/core-impl/Stream.h b/audio/aidl/default/include/core-impl/Stream.h
index 304f9b7..d8bac82 100644
--- a/audio/aidl/default/include/core-impl/Stream.h
+++ b/audio/aidl/default/include/core-impl/Stream.h
@@ -146,8 +146,8 @@
     // locking because it only cleans MQ pointers which were also set on the Binder thread.
     void reset();
     // 'advanceFrameCount' and 'getFrameCount' are only called on the worker thread.
-    long advanceFrameCount(size_t increase) { return mFrameCount += increase; }
-    long getFrameCount() const { return mFrameCount; }
+    int64_t advanceFrameCount(size_t increase) { return mFrameCount += increase; }
+    int64_t getFrameCount() const { return mFrameCount; }
 
   private:
     // Fields are non const to allow move assignment.
@@ -165,7 +165,7 @@
     std::shared_ptr<IStreamOutEventCallback> mOutEventCallback;  // Only used by output streams
     std::weak_ptr<sounddose::StreamDataProcessorInterface> mStreamDataProcessor;
     DebugParameters mDebugParameters;
-    long mFrameCount = 0;
+    int64_t mFrameCount = 0;
 };
 
 // This interface provides operations of the stream which are executed on the worker thread.