From 3f854035a48cbaa5059996f039fb0fa2ecd69743 Mon Sep 17 00:00:00 2001 From: Yamit Mehta Date: Sun, 12 Jul 2015 18:05:35 +0530 Subject: Initialize the start time if not specified in meta data If the start time is not specified in meta data, the start time will be assigned with latency of AudioRecord, it's calculated by allocated frame count which is not the real start time when the first frame received Initialize the start time to the current system time if not specified in meta data CRs-Fixed: 812379 Change-Id: Ia007ca4592fe1f96e105d4ec48305c578b677bb1 --- media/libstagefright/AudioSource.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp index 3505844..01400f6 100644 --- a/media/libstagefright/AudioSource.cpp +++ b/media/libstagefright/AudioSource.cpp @@ -124,6 +124,8 @@ status_t AudioSource::start(MetaData *params) { int64_t startTimeUs; if (params && params->findInt64(kKeyTime, &startTimeUs)) { mStartTimeUs = startTimeUs; + } else { + mStartTimeUs = systemTime() / 1000ll; } status_t err = mRecord->start(); if (err == OK) { -- cgit v1.1