Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Unified Diff: media/formats/webm/webm_audio_client.cc

Issue 437813005: change opus sample format to kSampleFormatF32 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: single opus if-block Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/webm/webm_audio_client.cc
diff --git a/media/formats/webm/webm_audio_client.cc b/media/formats/webm/webm_audio_client.cc
index e0d382c256b12707aafd0b8a78c1679a16c72d81..92bb40f0ace1be47ed4d346c628e41c4d5702cb7 100644
--- a/media/formats/webm/webm_audio_client.cc
+++ b/media/formats/webm/webm_audio_client.cc
@@ -29,6 +29,7 @@ bool WebMAudioClient::InitializeConfig(
int64 seek_preroll, int64 codec_delay, bool is_encrypted,
AudioDecoderConfig* config) {
DCHECK(config);
+ SampleFormat sample_format = kSampleFormatPlanarF32;
AudioCodec audio_codec = kUnknownAudioCodec;
if (codec_id == "A_VORBIS") {
@@ -60,8 +61,10 @@ bool WebMAudioClient::InitializeConfig(
// Always use 48kHz for OPUS. See the "Input Sample Rate" section of the
// spec: http://tools.ietf.org/html/draft-terriberry-oggopus-01#page-11
- if (audio_codec == kCodecOpus)
+ if (audio_codec == kCodecOpus) {
samples_per_second = 48000;
+ sample_format = kSampleFormatF32;
+ }
const uint8* extra_data = NULL;
size_t extra_data_size = 0;
@@ -81,7 +84,7 @@ bool WebMAudioClient::InitializeConfig(
config->Initialize(
audio_codec,
- (audio_codec == kCodecOpus) ? kSampleFormatS16 : kSampleFormatPlanarF32,
+ sample_format,
channel_layout,
samples_per_second,
extra_data,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698