mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 879743 - Fake audio should be sent at the same rate as fake video r=jesup
This commit is contained in:
parent
7fe8540ff0
commit
7bf9622aff
@ -44,6 +44,7 @@ public:
|
|||||||
static const int DEFAULT_VIDEO_MIN_FPS = 10;
|
static const int DEFAULT_VIDEO_MIN_FPS = 10;
|
||||||
static const int DEFAULT_VIDEO_WIDTH = 640;
|
static const int DEFAULT_VIDEO_WIDTH = 640;
|
||||||
static const int DEFAULT_VIDEO_HEIGHT = 480;
|
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
|
/* Populate an array of video sources in the nsTArray. Also include devices
|
||||||
* that are currently unavailable. */
|
* that are currently unavailable. */
|
||||||
|
@ -336,7 +336,7 @@ MediaEngineDefaultAudioSource::Start(SourceMediaStream* aStream, TrackID aID)
|
|||||||
mTrackID = aID;
|
mTrackID = aID;
|
||||||
|
|
||||||
// 1 Audio frame per Video frame
|
// 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);
|
nsITimer::TYPE_REPEATING_SLACK);
|
||||||
mState = kStarted;
|
mState = kStarted;
|
||||||
|
|
||||||
@ -373,7 +373,9 @@ NS_IMETHODIMP
|
|||||||
MediaEngineDefaultAudioSource::Notify(nsITimer* aTimer)
|
MediaEngineDefaultAudioSource::Notify(nsITimer* aTimer)
|
||||||
{
|
{
|
||||||
AudioSegment segment;
|
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);
|
mSource->AppendToTrack(mTrackID, &segment);
|
||||||
|
|
||||||
|
@ -58,11 +58,6 @@ public:
|
|||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
NS_DECL_NSITIMERCALLBACK
|
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:
|
protected:
|
||||||
friend class MediaEngineDefault;
|
friend class MediaEngineDefault;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user