Closed Bug 469628 Opened 16 years ago Closed 16 years ago

Playing 8-bit Wave files can block writing to the audio backend

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1

People

(Reporter: kinetik, Assigned: kinetik)

Details

(Keywords: fixed1.9.1)

Attachments

(1 file)

The minimum length to write is calculated incorrectly: RoundDownToSample(NS_MIN(mStream->Available(), PRUint32(mAudioStream->Available() * sizeof(short)))); nsAudioStream::Available returns the number of samples you can write without blocking. Unconditionally multiplying the result by sizeof(short) is wrong for 8-bit samples, since each sample is only 1 byte. This can result in len being twice the Available() size when dealing with 8-bit samples. Patch coming up.
Flags: blocking1.9.1?
Attached patch patch v0Splinter Review
Fix.
Attachment #352978 - Flags: superreview?(roc)
Attachment #352978 - Flags: review?(chris.double)
Attachment #352978 - Flags: review?(chris.double) → review+
Attachment #352978 - Flags: superreview?(roc) → superreview+
Flags: blocking1.9.1? → blocking1.9.1+
Keywords: checkin-needed
Whiteboard: [needs landing]
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [needs landing] → [needs landing][baking for 1.9.1]
Whiteboard: [needs landing][baking for 1.9.1] → [needs landing][baking for 1.9.1][needs 1.9.1 landing]
Whiteboard: [needs landing][baking for 1.9.1][needs 1.9.1 landing] → [baking for 1.9.1][needs 191 landing]
Pushed 86ba3318a573 to 1.9.1
Keywords: fixed1.9.1
Whiteboard: [baking for 1.9.1][needs 191 landing]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: