mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1182444: Show audio as enabled when an audio track is present in stream. r=jesup
This commit is contained in:
parent
fc1b65e187
commit
70c1e1f031
@ -3569,6 +3569,12 @@ HTMLMediaElement::UpdateReadyStateInternal()
|
||||
// We are playing a stream that has video and a video frame is now set.
|
||||
// This means we have all metadata needed to change ready state.
|
||||
MediaInfo mediaInfo = mMediaInfo;
|
||||
if (hasAudio) {
|
||||
mediaInfo.EnableAudio();
|
||||
}
|
||||
if (hasVideo) {
|
||||
mediaInfo.EnableVideo();
|
||||
}
|
||||
MetadataLoaded(&mediaInfo, nsAutoPtr<const MetadataTags>(nullptr));
|
||||
}
|
||||
|
||||
|
@ -339,11 +339,32 @@ public:
|
||||
return mVideo.IsValid();
|
||||
}
|
||||
|
||||
void EnableVideo()
|
||||
{
|
||||
if (HasVideo()) {
|
||||
return;
|
||||
}
|
||||
// Set dummy values so that HasVideo() will return true;
|
||||
// See VideoInfo::IsValid()
|
||||
mVideo.mDisplay = nsIntSize(1, 1);
|
||||
}
|
||||
|
||||
bool HasAudio() const
|
||||
{
|
||||
return mAudio.IsValid();
|
||||
}
|
||||
|
||||
void EnableAudio()
|
||||
{
|
||||
if (HasAudio()) {
|
||||
return;
|
||||
}
|
||||
// Set dummy values so that HasAudio() will return true;
|
||||
// See AudioInfo::IsValid()
|
||||
mAudio.mChannels = 2;
|
||||
mAudio.mRate = 44100;
|
||||
}
|
||||
|
||||
bool IsEncrypted() const
|
||||
{
|
||||
return mCrypto.IsEncrypted();
|
||||
|
Loading…
Reference in New Issue
Block a user