Bug 879743 - Fake audio should be sent at the same rate as fake video r=jesup

This commit is contained in:
Ethan Hugg 2013-06-20 10:14:04 -07:00
parent af0e73008e
commit 7d3811cc7c
3 changed files with 5 additions and 7 deletions

View File

@ -44,6 +44,7 @@ public:
static const int DEFAULT_VIDEO_MIN_FPS = 10;
static const int DEFAULT_VIDEO_WIDTH = 640;
static const int DEFAULT_VIDEO_HEIGHT = 480;
static const int DEFAULT_AUDIO_TIMER_MS = 10;
/* Populate an array of video sources in the nsTArray. Also include devices
* that are currently unavailable. */

View File

@ -336,7 +336,7 @@ MediaEngineDefaultAudioSource::Start(SourceMediaStream* aStream, TrackID aID)
mTrackID = aID;
// 1 Audio frame per Video frame
mTimer->InitWithCallback(this, 1000 / MediaEngineDefaultVideoSource::DEFAULT_VIDEO_FPS,
mTimer->InitWithCallback(this, MediaEngine::DEFAULT_AUDIO_TIMER_MS,
nsITimer::TYPE_REPEATING_SLACK);
mState = kStarted;
@ -373,7 +373,9 @@ NS_IMETHODIMP
MediaEngineDefaultAudioSource::Notify(nsITimer* aTimer)
{
AudioSegment segment;
segment.InsertNullDataAtStart(AUDIO_RATE/100); // 10ms of fake data
// Notify timer is set every DEFAULT_AUDIO_TIMER_MS milliseconds.
segment.InsertNullDataAtStart((AUDIO_RATE * MediaEngine::DEFAULT_AUDIO_TIMER_MS) / 1000);
mSource->AppendToTrack(mTrackID, &segment);

View File

@ -58,11 +58,6 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSITIMERCALLBACK
static const int DEFAULT_VIDEO_FPS = 60;
static const int DEFAULT_VIDEO_MIN_FPS = 10;
static const int DEFAULT_VIDEO_WIDTH = 640;
static const int DEFAULT_VIDEO_HEIGHT = 480;
protected:
friend class MediaEngineDefault;