Closed Bug 1444519 Opened 7 years ago Closed 5 months ago

media/libcubeb/src/cubeb_pulse.c ignores many PulseAudio errors

Categories

(Core :: Audio/Video: cubeb, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: oxij, Unassigned)

Details

Attachments

(1 file)

In media/libcubeb/src/cubeb_pulse.c many calls to PA API never check return codes. I discovered this while I was debugging why Firefox crashes with my "superior reimplementation" of libpulse API (https://github.com/oxij/libcardiacarrest). Newer code tied to Rust does check those error codes. The fix I needed for my use case is attached. I made a workaround for this anyway, so you may completely ignore this. But if you look at PA API documentation, you'll notice that not only cubeb_pulse.c ignores some PA errors, it is not entirely clear whenever all of the uses of PA API in cubeb_pulse.c are even correct. For instance, is it ok to `drain` the `pa_context` before it successfully connected to the PA daemon? I'm not sure. cubeb_pulse.c `drain`s it anyway.
Component: Untriaged → Audio/Video: cubeb
Product: Firefox → Core
Alex, can I ask you to take a look if want to merge this contribution?
Status: UNCONFIRMED → NEW
Rank: 25
Ever confirmed: true
Flags: needinfo?(achronop)
Priority: -- → P3
Thank you for the patch. It's true we could be better in error checking. In order to patch libcubeb you should create a PR request against the upstream github repository (https://github.com/kinetiknz/cubeb). Every so often we import all latest changes of that repository into gecko. Can you transfer your patch into a PR against that repo? If not, let me know and I will do it for you.
Flags: needinfo?(achronop) → needinfo?(oxij)
Flags: needinfo?(oxij)
Severity: minor → S4

This was fixed since.

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: