Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep a map between channel position and channel index for decoded audio #23215

Merged
merged 1 commit into from Apr 18, 2019

Conversation

@ferjm
Copy link
Member

ferjm commented Apr 16, 2019

  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are WPTs for these changes.

This should help fixing #22842 (along with https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/183). I couldn't reproduce it locally, so I cannot tell for sure.


This change is Reviewable

@highfive
Copy link

highfive commented Apr 16, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/baseaudiocontext.rs
  • @KiChjang: components/script/dom/baseaudiocontext.rs
@ferjm
Copy link
Member Author

ferjm commented Apr 16, 2019

r? @jdm

@highfive
Copy link

highfive commented Apr 16, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@highfive highfive assigned jdm and unassigned SimonSapin Apr 16, 2019
@ferjm
Copy link
Member Author

ferjm commented Apr 16, 2019

@bors-servo try=wpt

let mut decoded_audio = decoded_audio_.lock().unwrap();
let mut channels = channels.lock().unwrap();
let channel = if channels.contains_key(&channel_pos) {
*channels.get(&channel_pos).unwrap()

This comment has been minimized.

@jdm

jdm Apr 16, 2019

Member
let channel = match channels.entry_mut(channel_pos) {
    Entry::Occupied(entry) => *entry.get(),
    Entry::Vacant(entry) => *entry.insert(decoded_audio.len()),
};
bors-servo added a commit that referenced this pull request Apr 16, 2019
Keep a map between channel position and channel index for decoded audio

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are WPTs for these changes.

This should help fixing #22842 (along with https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/183). I couldn't reproduce it locally, so I cannot tell for sure.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23215)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 16, 2019

Trying commit 0e19956 with merge 44558dd...

@bors-servo
Copy link
Contributor

bors-servo commented Apr 16, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Apr 16, 2019

I'll try this out locally.

@ferjm ferjm force-pushed the ferjm:decoder.channels branch from 0e19956 to 292d170 Apr 17, 2019
@jdm
Copy link
Member

jdm commented Apr 18, 2019

This indeed makes the panic disappear.
@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Apr 18, 2019

📌 Commit 292d170 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Apr 18, 2019

Testing commit 292d170 with merge b20333a...

bors-servo added a commit that referenced this pull request Apr 18, 2019
Keep a map between channel position and channel index for decoded audio

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] There are WPTs for these changes.

This should help fixing #22842 (along with https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/183). I couldn't reproduce it locally, so I cannot tell for sure.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23215)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 18, 2019

@bors-servo bors-servo merged commit 292d170 into servo:master Apr 18, 2019
4 checks passed
4 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
@ferjm ferjm deleted the ferjm:decoder.channels branch Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.