Uninitialized variables in CubebUtils

RESOLVED FIXED in Firefox 58

Status

()

P3
normal
Rank:
15
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: philn, Assigned: philn)

Tracking

Trunk
mozilla58
Points:
---

Firefox Tracking Flags

(firefox56 unaffected, firefox57 unaffected, firefox58 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

a year ago
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36

Steps to reproduce:

For gecko-media we don't rely on Preferences (yet?) so we need default values for at least the sCubebPlaybackLatencyInMilliseconds variable.
(Assignee)

Updated

a year ago
Blocks: 1388605
(Assignee)

Updated

a year ago
Summary: Uninitialized variables → Uninitialized variables in CubebUtils
(Assignee)

Comment 1

a year ago
Created attachment 8908083 [details] [diff] [review]
proposed.patch
Attachment #8908083 - Flags: review?(cpearce)
Component: Audio/Video → Audio/Video: cubeb
Does this apply to 56?
Rank: 15
status-firefox56: --- → ?
status-firefox57: --- → affected
Priority: -- → P2
Maire, you don't need to worry about this. This is not a problem in Firefox. These variables are initialized when we initialize Cubeb in Firefox.

I'm setting the tracking flags to unaffected so that nobody panics about this.

For the gecko-media Rust crate, I think we can just initialize the Preferences system so that these prefs are initialized just like they are in Firefox. I'm part way through that patch.
status-firefox56: ? → unaffected
status-firefox57: affected → unaffected
Priority: P2 → P3
Comment on attachment 8908083 [details] [diff] [review]
proposed.patch

I think sCubebPlaybackLatencyInMillisecond should be initialized to  CUBEB_NORMAL_LATENCY_MS.

I think sCubebMSGLatencyInFrames should be initiaized to CUBEB_NORMAL_LATENCY_FRAMES.

Paul, can you take a look at this and suggest whether these are sane default values? We need these as we're exporting Gecko's media stack out into a Rust crate, and the preferences system isn't stood up yet.
Attachment #8908083 - Flags: review?(cpearce) → review?(padenot)
Comment on attachment 8908083 [details] [diff] [review]
proposed.patch

Review of attachment 8908083 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/media/CubebUtils.cpp
@@ +106,5 @@
>    Shutdown
>  } sCubebState = CubebState::Uninitialized;
>  cubeb* sCubebContext;
> +double sVolumeScale = 1.0;
> +uint32_t sCubebPlaybackLatencyInMilliseconds = 1;

Makes this 100 milliseconds.

@@ +107,5 @@
>  } sCubebState = CubebState::Uninitialized;
>  cubeb* sCubebContext;
> +double sVolumeScale = 1.0;
> +uint32_t sCubebPlaybackLatencyInMilliseconds = 1;
> +uint32_t sCubebMSGLatencyInFrames = 128;

Make this 512 frames. Note that in practice, we get this value via cubeb, it depends widely on the platform.
Attachment #8908083 - Flags: review?(padenot)
Created attachment 8911785 [details] [diff] [review]
set default values for variables controlled by Preferences

This is needed for Servo's gecko-media where there is no support for
Mozilla Preferences.

MozReview-Commit-ID: HbDT42SRrE3
Assignee: nobody → cpearce
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Comment 7

a year ago
Pushed by cpearce@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a0bd70eac827
set default values for variables controlled by Preferences. r=padenot
Assignee: cpearce → philn

Comment 8

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/a0bd70eac827
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox58: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.