зеркало из https://github.com/mozilla/gecko-dev.git
Bug 900811 - Fix the hang if closing its tab during recording a fake gUM. r=roc
This commit is contained in:
Родитель
ae052c7acf
Коммит
78d33c4c72
|
@ -67,16 +67,24 @@ AudioTrackEncoder::NotifyRemoved(MediaStreamGraph* aGraph)
|
|||
{
|
||||
// In case that MediaEncoder does not receive a TRACK_EVENT_ENDED event.
|
||||
LOG("[AudioTrackEncoder]: NotifyRemoved.");
|
||||
NotifyEndOfStream();
|
||||
}
|
||||
|
||||
void
|
||||
AudioTrackEncoder::NotifyEndOfStream()
|
||||
{
|
||||
// If source audio chunks are completely silent till the end of encoding,
|
||||
// initialize the encoder with default channel counts and sampling rate, and
|
||||
// append this many null data to the segment of track encoder.
|
||||
if (!mInitialized && mSilentDuration > 0) {
|
||||
if (!mCanceled && !mInitialized && mSilentDuration > 0) {
|
||||
Init(DEFAULT_CHANNELS, DEFAULT_SAMPLING_RATE);
|
||||
mRawSegment->AppendNullData(mSilentDuration);
|
||||
mSilentDuration = 0;
|
||||
}
|
||||
NotifyEndOfStream();
|
||||
|
||||
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
||||
mEndOfStream = true;
|
||||
mReentrantMonitor.NotifyAll();
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -130,12 +130,7 @@ protected:
|
|||
* Notifies the audio encoder that we have reached the end of source stream,
|
||||
* and wakes up mReentrantMonitor if encoder is waiting for more track data.
|
||||
*/
|
||||
void NotifyEndOfStream()
|
||||
{
|
||||
ReentrantMonitorAutoEnter mon(mReentrantMonitor);
|
||||
mEndOfStream = true;
|
||||
mReentrantMonitor.NotifyAll();
|
||||
}
|
||||
void NotifyEndOfStream();
|
||||
|
||||
/**
|
||||
* Interleaves the track data and stores the result into aOutput. Might need
|
||||
|
|
Загрузка…
Ссылка в новой задаче