Closed Bug 1089159 Opened 5 years ago Closed 5 years ago

AndroidDecoderModule uses incorrect sampling rate for AAC SBR tracks

Categories

(Core :: Audio/Video, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla36
Tracking Status
firefox34 --- fixed
firefox35 --- fixed
firefox36 --- fixed
fennec 36+ ---

People

(Reporter: snorp, Assigned: snorp)

References

()

Details

Attachments

(1 file)

tracking-fennec: --- → ?
The metadata we get in AudioDecoderConfig claims the audio is 1 channel, 16bit, 22k. But clearly that's not accurate. On some loads I get an ad that plays before the actual video with the same metadata but it sounds fine.
OK, the video in question here is mono/44k and MP4Reader claims it is mono/22k.
Summary: Audio sounds like it's playing in slow motion → MP4Reader gives wrong sample rate (22k instead of 44k)
Component: General → Video/Audio
Product: Firefox for Android → Core
Hardware: Other → All
MPEG4Extractor seems to see the 22k sample rate in two places: the sawb chunk, and the esds (based on frequency index 7). Somehow Quicktime and VLC get 44k.
Alright, think I have this figured out. This is a SBR track, and there is some mode here where the decoded output is double the sample rate of the input. It looks like MediaFormat has some stuff we can use to figure this out.
Nevermind, the MediaFormat stuff is only used during encoding. Is there a way the MPEG4Extractor can get this? (Edwin, see prior comments re: SBR mode)
Flags: needinfo?(edwin)
Attachment #8512948 - Flags: review?(cpearce) → review+
Summary: MP4Reader gives wrong sample rate (22k instead of 44k) → AndroidDecoderModule uses incorrect sampling rate for AAC SBR tracks
Oops, the debug build was hosed. Repushed with the typo fixed.

https://hg.mozilla.org/integration/mozilla-inbound/rev/8638faa1a83b
Flags: needinfo?(snorp)
tracking-fennec: ? → 36+
https://hg.mozilla.org/mozilla-central/rev/8638faa1a83b
Assignee: nobody → snorp
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Comment on attachment 8512948 [details] [diff] [review]
Correctly use MediaCodec's audio output format

Approval Request Comment
[Feature/regressing bug #]: bug 1014614
[User impact if declined]: Improper audio playback of some AAC files
[Describe test coverage new/current, TBPL]: Nightly for a week
[Risks and why]: Low risk, uses known correct sample rate from decoder
[String/UUID change made/needed]: None
Attachment #8512948 - Flags: approval-mozilla-beta?
Attachment #8512948 - Flags: approval-mozilla-aurora?
Attachment #8512948 - Flags: approval-mozilla-beta?
Attachment #8512948 - Flags: approval-mozilla-beta+
Attachment #8512948 - Flags: approval-mozilla-aurora?
Attachment #8512948 - Flags: approval-mozilla-aurora+
Looks like snorp landed this on Aurora and forgot to mark the bug.

https://hg.mozilla.org/releases/mozilla-aurora/rev/ba9a79c05e9a
You need to log in before you can comment on or make changes to this bug.