mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1496497 - Consider 768kHz files valid, but resample down to 384kHz for playback. r=media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D205873
This commit is contained in:
parent
6959b6a939
commit
ae57f69e55
@ -562,7 +562,7 @@ class AudioInfo : public TrackInfo {
|
||||
|
||||
bool operator==(const AudioInfo& rhs) const;
|
||||
|
||||
static const uint32_t MAX_RATE = 640000;
|
||||
static const uint32_t MAX_RATE = 768000;
|
||||
static const uint32_t MAX_CHANNEL_COUNT = 256;
|
||||
|
||||
bool IsValid() const override {
|
||||
|
@ -188,12 +188,13 @@ uint32_t DecideAudioPlaybackSampleRate(const AudioInfo& aInfo,
|
||||
rate = 48000;
|
||||
} else if (aInfo.mRate >= 44100) {
|
||||
// The original rate is of good quality and we want to minimize unecessary
|
||||
// resampling, so we let cubeb decide how to resample (if needed).
|
||||
rate = aInfo.mRate;
|
||||
// resampling, so we let cubeb decide how to resample (if needed). Cap to
|
||||
// 384kHz for good measure.
|
||||
rate = std::min<unsigned>(aInfo.mRate, 384000u);
|
||||
} else {
|
||||
// We will resample all data to match cubeb's preferred sampling rate.
|
||||
rate = CubebUtils::PreferredSampleRate(aShouldResistFingerprinting);
|
||||
if (rate > 384000) {
|
||||
if (rate > 768000) {
|
||||
// bogus rate, fall back to something else;
|
||||
rate = 48000;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user