mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 844951 - Setting playbackRate and mozPreservesPitch before the decoder creation should work. r=kinetik
This commit is contained in:
parent
4f2efc2090
commit
e3f9f4377e
@ -2359,6 +2359,9 @@ nsresult nsHTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder,
|
||||
aDecoder->SetAudioChannelType(mAudioChannelType);
|
||||
aDecoder->SetAudioCaptured(mAudioCaptured);
|
||||
aDecoder->SetVolume(mMuted ? 0.0 : mVolume);
|
||||
aDecoder->SetPreservesPitch(mPreservesPitch);
|
||||
aDecoder->SetPlaybackRate(mPlaybackRate);
|
||||
|
||||
for (uint32_t i = 0; i < mOutputStreams.Length(); ++i) {
|
||||
OutputMediaStream* ms = &mOutputStreams[i];
|
||||
aDecoder->AddOutputStream(ms->mStream->GetStream()->AsProcessedStream(),
|
||||
|
@ -327,6 +327,8 @@ MediaDecoder::MediaDecoder() :
|
||||
mPlaybackPosition(0),
|
||||
mCurrentTime(0.0),
|
||||
mInitialVolume(0.0),
|
||||
mInitialPlaybackRate(1.0),
|
||||
mInitialPreservesPitch(true),
|
||||
mRequestedSeekTime(-1.0),
|
||||
mDuration(-1),
|
||||
mTransportSeekable(true),
|
||||
@ -468,6 +470,8 @@ nsresult MediaDecoder::InitializeStateMachine(MediaDecoder* aCloneDonor)
|
||||
mDecoderStateMachine->SetDuration(mDuration);
|
||||
mDecoderStateMachine->SetVolume(mInitialVolume);
|
||||
mDecoderStateMachine->SetAudioCaptured(mInitialAudioCaptured);
|
||||
SetPlaybackRate(mInitialPlaybackRate);
|
||||
mDecoderStateMachine->SetPreservesPitch(mInitialPreservesPitch);
|
||||
|
||||
if (mFrameBufferLength > 0) {
|
||||
// The valid mFrameBufferLength value was specified earlier
|
||||
@ -1401,6 +1405,8 @@ void MediaDecoder::SetPlaybackRate(double aPlaybackRate)
|
||||
|
||||
if (mDecoderStateMachine) {
|
||||
mDecoderStateMachine->SetPlaybackRate(aPlaybackRate);
|
||||
} else {
|
||||
mInitialPlaybackRate = aPlaybackRate;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1408,6 +1414,8 @@ void MediaDecoder::SetPreservesPitch(bool aPreservesPitch)
|
||||
{
|
||||
if (mDecoderStateMachine) {
|
||||
mDecoderStateMachine->SetPreservesPitch(aPreservesPitch);
|
||||
} else {
|
||||
mInitialPreservesPitch = aPreservesPitch;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -901,6 +901,11 @@ public:
|
||||
// volume. Readable/Writeable from the main thread.
|
||||
double mInitialVolume;
|
||||
|
||||
// PlaybackRate and pitch preservation status we should start at.
|
||||
// Readable/Writeable from the main thread.
|
||||
double mInitialPlaybackRate;
|
||||
bool mInitialPreservesPitch;
|
||||
|
||||
// Position to seek to when the seek notification is received by the
|
||||
// decode thread. Written by the main thread and read via the
|
||||
// decode thread. Synchronised using mReentrantMonitor. If the
|
||||
|
Loading…
Reference in New Issue
Block a user