File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 2020
2121#include < binder/IPCThreadState.h>
2222#include < media/AudioTrack.h>
23+ #include < media/stagefright/foundation/ADebug.h>
2324#include < media/stagefright/AudioPlayer.h>
24- #include < media/stagefright/MediaDebug.h>
2525#include < media/stagefright/MediaDefs.h>
2626#include < media/stagefright/MediaErrors.h>
2727#include < media/stagefright/MediaSource.h>
@@ -60,7 +60,7 @@ AudioPlayer::~AudioPlayer() {
6060}
6161
6262void AudioPlayer::setSource (const sp<MediaSource> &source) {
63- CHECK_EQ (mSource , NULL );
63+ CHECK (mSource == NULL );
6464 mSource = source;
6565}
6666
@@ -466,6 +466,8 @@ int64_t AudioPlayer::getRealTimeUs() {
466466}
467467
468468int64_t AudioPlayer::getRealTimeUsLocked () const {
469+ CHECK (mStarted );
470+ CHECK_NE (mSampleRate , 0 );
469471 return -mLatencyUs + (mNumFramesPlayed * 1000000 ) / mSampleRate ;
470472}
471473
Original file line number Diff line number Diff line change @@ -1736,7 +1736,9 @@ void AwesomePlayer::onVideoEvent() {
17361736 modifyFlags (TEXT_RUNNING, SET);
17371737 }
17381738
1739- TimeSource *ts = (mFlags & AUDIO_AT_EOS) ? &mSystemTimeSource : mTimeSource ;
1739+ TimeSource *ts =
1740+ ((mFlags & AUDIO_AT_EOS) || !(mFlags & AUDIOPLAYER_STARTED))
1741+ ? &mSystemTimeSource : mTimeSource ;
17401742
17411743 if (mFlags & FIRST_FRAME) {
17421744 modifyFlags (FIRST_FRAME, CLEAR);
You can’t perform that action at this time.
0 commit comments