Closed Bug 984698 Opened 10 years ago Closed 10 years ago

Reduce audio preroll when we don't have a video stream

Categories

(Core :: Audio/Video, defect)

29 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: cpearce, Assigned: cpearce)

References

Details

Attachments

(1 file)

If the MediaDecoderStateMachine is not decoding a video stream, we can reduce the amount of audio we decode ahead of the current playback position because we don't have to worry about a slow video decode hogging the CPU and causing audio underruns.

This will reduce our memory usage, as a 48kHz stereo audio stream uses 48000x2x2=192,000 bytes to buffer 1s on mobile, and twice that on desktop. On low end devices like the Tarako, memory is scarce.
Reduce our audio decode-ahead when we don't have a video stream.

I've tested this on B2G/Tarako, and an ASUS T100 Win8 tablet (ATOM Z2760 CPU), so I think slow CPUs/hardware should be able to handle this.
Attachment #8392612 - Flags: review?(paul)
Comment on attachment 8392612 [details] [diff] [review]
Patch: Reduce audio preroll when we don't have a video stream

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

::: content/media/MediaDecoderStateMachine.cpp
@@ +1869,5 @@
> +    // order to reduce memory usage.
> +    mAmpleAudioThresholdUsecs /= NO_VIDEO_AMPLE_AUDIO_DIVISOR;
> +    mLowAudioThresholdUsecs /= NO_VIDEO_AMPLE_AUDIO_DIVISOR;
> +  }
> +  

nit: trailing space.
Attachment #8392612 - Flags: review?(paul) → review+
https://hg.mozilla.org/mozilla-central/rev/e076f1fb825b
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Depends on: 1045591
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: