mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 19:33:18 +00:00
Bug 1139256 - remove the assertion in AudioStream::GetPositionInFramesUnlocked(). See bug 1139256 comment 4 for the detail. r=kinetik.
This commit is contained in:
parent
cec734c5f4
commit
32d2d557d7
@ -130,7 +130,6 @@ AudioStream::AudioStream()
|
||||
, mDumpFile(nullptr)
|
||||
, mBytesPerFrame(0)
|
||||
, mState(INITIALIZED)
|
||||
, mLastGoodPosition(0)
|
||||
, mIsMonoAudioEnabled(gfxPrefs::MonoAudio())
|
||||
{
|
||||
}
|
||||
@ -622,12 +621,7 @@ AudioStream::GetPositionInFramesUnlocked()
|
||||
}
|
||||
}
|
||||
|
||||
MOZ_ASSERT(position >= mLastGoodPosition, "cubeb position shouldn't go backward");
|
||||
// This error handling/recovery keeps us in good shape in release build.
|
||||
if (position >= mLastGoodPosition) {
|
||||
mLastGoodPosition = position;
|
||||
}
|
||||
return std::min<uint64_t>(mLastGoodPosition, INT64_MAX);
|
||||
return std::min<uint64_t>(position, INT64_MAX);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -322,9 +322,6 @@ private:
|
||||
|
||||
StreamState mState;
|
||||
bool mIsFirst;
|
||||
// The last good position returned by cubeb_stream_get_position(). Used to
|
||||
// check if the cubeb position is going backward.
|
||||
uint64_t mLastGoodPosition;
|
||||
// Get this value from the preferece, if true, we would downmix the stereo.
|
||||
bool mIsMonoAudioEnabled;
|
||||
};
|
||||
|
@ -143,8 +143,12 @@ DecodedAudioDataSink::GetPosition()
|
||||
int64_t pos;
|
||||
if (mAudioStream &&
|
||||
(pos = mAudioStream->GetPosition()) >= 0) {
|
||||
NS_ASSERTION(pos >= mLastGoodPosition,
|
||||
"AudioStream position shouldn't go backward");
|
||||
// Update the last good position when we got a good one.
|
||||
mLastGoodPosition = pos;
|
||||
if (pos >= mLastGoodPosition) {
|
||||
mLastGoodPosition = pos;
|
||||
}
|
||||
}
|
||||
|
||||
return mStartTime + mLastGoodPosition;
|
||||
|
Loading…
Reference in New Issue
Block a user