Bug 1276569. Part 1 - remove null checks. r=kinetik.
MozReview-Commit-ID: IpX4B2GTr9k
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -418,19 +418,16 @@ AudioStream::Start()
MonitorAutoLock mon(mMonitor);
StartUnlocked();
}
void
AudioStream::StartUnlocked()
{
mMonitor.AssertCurrentThreadOwns();
- if (!mCubebStream) {
- return;
- }
if (mState == INITIALIZED) {
mState = STARTED;
int r;
{
MonitorAutoUnlock mon(mMonitor);
r = cubeb_stream_start(mCubebStream.get());
// DataCallback might be called before we exit this scope
@@ -448,17 +445,17 @@ void
AudioStream::Pause()
{
MonitorAutoLock mon(mMonitor);
if (mState == ERRORED) {
return;
}
- if (!mCubebStream || (mState != STARTED && mState != RUNNING)) {
+ if (mState != STARTED && mState != RUNNING) {
mState = STOPPED; // which also tells async OpenCubeb not to start, just init
return;
}
int r;
{
MonitorAutoUnlock mon(mMonitor);
r = cubeb_stream_stop(mCubebStream.get());
@@ -467,17 +464,17 @@ AudioStream::Pause()
mState = STOPPED;
}
}
void
AudioStream::Resume()
{
MonitorAutoLock mon(mMonitor);
- if (!mCubebStream || mState != STOPPED) {
+ if (mState != STOPPED) {
return;
}
int r;
{
MonitorAutoUnlock mon(mMonitor);
r = cubeb_stream_start(mCubebStream.get());
}
@@ -518,17 +515,17 @@ AudioStream::GetPositionInFrames()
return mAudioClock.GetPositionInFrames();
}
int64_t
AudioStream::GetPositionInFramesUnlocked()
{
mMonitor.AssertCurrentThreadOwns();
- if (!mCubebStream || mState == ERRORED) {
+ if (mState == ERRORED) {
return -1;
}
uint64_t position = 0;
{
MonitorAutoUnlock mon(mMonitor);
if (cubeb_stream_get_position(mCubebStream.get(), &position) != CUBEB_OK) {
return -1;