Bug 1164697 - Fix time unit of AudioOffloadPlayer r=bholley

This commit is contained in:
Sotaro Ikeda 2015-05-14 15:48:06 -07:00
Родитель dfa3b487fe
Коммит dcb4911aa5
4 изменённых файлов: 3 добавлений и 12 удалений

Просмотреть файл

@ -385,13 +385,6 @@ status_t AudioOffloadPlayer::DoSeek()
return OK;
}
double AudioOffloadPlayer::GetMediaTimeSecs()
{
MOZ_ASSERT(NS_IsMainThread());
return (static_cast<double>(GetMediaTimeUs()) /
static_cast<double>(USECS_PER_S));
}
int64_t AudioOffloadPlayer::GetMediaTimeUs()
{
android::Mutex::Autolock autoLock(mLock);

Просмотреть файл

@ -88,7 +88,7 @@ public:
virtual void SetVolume(double aVolume) override;
virtual double GetMediaTimeSecs() override;
virtual int64_t GetMediaTimeUs() override;
// To update progress bar when the element is visible
virtual void SetElementVisibility(bool aIsVisible) override;;
@ -192,8 +192,6 @@ private:
// Used only from main thread so no lock is needed.
nsRefPtr<mozilla::dom::WakeLock> mWakeLock;
int64_t GetMediaTimeUs();
// Provide the playback position in microseconds from total number of
// frames played by audio track
int64_t GetOutputPlayPositionUs_l() const;

Просмотреть файл

@ -54,7 +54,7 @@ public:
virtual void SetVolume(double aVolume) {}
virtual double GetMediaTimeSecs() { return 0; }
virtual int64_t GetMediaTimeUs() { return 0; }
// To update progress bar when the element is visible
virtual void SetElementVisibility(bool aIsVisible) {}

Просмотреть файл

@ -244,7 +244,7 @@ MediaOmxCommonDecoder::CurrentPosition()
}
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
return mAudioOffloadPlayer->GetMediaTimeSecs();
return mAudioOffloadPlayer->GetMediaTimeUs();
}
void