Bug 1090293 - Fix failure to get audio on first getUserMedia after start r=jesup

fix GetTrackTypesAvailable to not report placeholder tracks
This commit is contained in:
Jan-Ivar Bruaroey 2014-11-07 23:25:22 -05:00
parent 6378e21c0a
commit 2bfd9ebf32
2 changed files with 3 additions and 5 deletions

View File

@ -345,11 +345,9 @@ DOMMediaStream::CreateDOMTrack(TrackID aTrackID, MediaSegment::Type aType)
switch (aType) {
case MediaSegment::AUDIO:
track = new AudioStreamTrack(this, aTrackID);
mTrackTypesAvailable |= HINT_CONTENTS_AUDIO;
break;
case MediaSegment::VIDEO:
track = new VideoStreamTrack(this, aTrackID);
mTrackTypesAvailable |= HINT_CONTENTS_VIDEO;
break;
default:
MOZ_CRASH("Unhandled track type");
@ -369,7 +367,7 @@ DOMMediaStream::BindDOMTrack(TrackID aTrackID, MediaSegment::Type aType)
track = mTracks[i]->AsAudioStreamTrack();
if (track) {
track->BindTrackID(aTrackID);
MOZ_ASSERT(mTrackTypesAvailable & HINT_CONTENTS_AUDIO);
mTrackTypesAvailable |= HINT_CONTENTS_AUDIO;
break;
}
}
@ -380,7 +378,7 @@ DOMMediaStream::BindDOMTrack(TrackID aTrackID, MediaSegment::Type aType)
track = mTracks[i]->AsVideoStreamTrack();
if (track) {
track->BindTrackID(aTrackID);
MOZ_ASSERT(mTrackTypesAvailable & HINT_CONTENTS_VIDEO);
mTrackTypesAvailable |= HINT_CONTENTS_VIDEO;
break;
}
}

View File

@ -288,7 +288,7 @@ protected:
// Indicate what track types we eventually expect to add to this stream
uint8_t mHintContents;
// Indicate what track types have been added to this stream
// Indicate what track types have arrived in this stream
uint8_t mTrackTypesAvailable;
bool mNotifiedOfMediaStreamGraphShutdown;