Do not update time offset for time lapse recording after pause
For cases when StagefrightRecorder is used for recording
videos with a different capture and frame ratio (time lapse
or slow motion) with a surface source, recorded video
is incorrectly updated by a capture/recorded fps ratio.
To fix this, such factor will be used only with camera source.
Bug: 119070689
Test: timelapse/slowmotion and pause/resume with surface input
Change-Id: Id9df526324f3ead8117eb4571f9459beceea9fff
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 30c0b1c..e3ae02e 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -1996,7 +1996,7 @@
mTotalPausedDurationUs += resumeStartTimeUs - mPauseStartTimeUs - 30000;
}
double timeOffset = -mTotalPausedDurationUs;
- if (mCaptureFpsEnable) {
+ if (mCaptureFpsEnable && (mVideoSource == VIDEO_SOURCE_CAMERA)) {
timeOffset *= mCaptureFps / mFrameRate;
}
sp<MetaData> meta = new MetaData;