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

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

Issue 239423005: Wire up codec_delay() to MP3StreamParser and FFmpegAudioDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ResetTimestampState() on config change. Created 6 years, 8 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 | « media/formats/mpeg/mpeg_audio_stream_parser_base.cc ('k') | 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 6de45028bb70e9f10096c40506c40aa628b1181d..6fe9a8434f23b0fbfe206d508230a7ea666a256f 100644
--- a/media/formats/webm/webm_audio_client.cc
+++ b/media/formats/webm/webm_audio_client.cc
@@ -65,15 +65,27 @@ bool WebMAudioClient::InitializeConfig(
extra_data_size = codec_private.size();
}
+ // Convert |codec_delay| from nanoseconds into frames.
+ int codec_delay_in_frames = 0;
+ if (codec_delay != -1) {
+ codec_delay_in_frames =
+ 0.5 +
+ samples_per_second * (static_cast<double>(codec_delay) /
+ base::Time::kNanosecondsPerSecond);
+ }
+
config->Initialize(
audio_codec,
(audio_codec == kCodecOpus) ? kSampleFormatS16 : kSampleFormatPlanarF32,
channel_layout,
- samples_per_second, extra_data, extra_data_size, is_encrypted, true,
+ samples_per_second,
+ extra_data,
+ extra_data_size,
+ is_encrypted,
+ true,
base::TimeDelta::FromMicroseconds(
(seek_preroll != -1 ? seek_preroll : 0) / 1000),
- base::TimeDelta::FromMicroseconds(
- (codec_delay != -1 ? codec_delay : 0) / 1000));
+ codec_delay_in_frames);
return config->IsValidConfig();
}
« no previous file with comments | « media/formats/mpeg/mpeg_audio_stream_parser_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698