summaryrefslogtreecommitdiffstats
path: root/media/ffmpeg/ffmpeg_common.cc
diff options
context:
space:
mode:
Diffstat (limited to 'media/ffmpeg/ffmpeg_common.cc')
-rw-r--r--media/ffmpeg/ffmpeg_common.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc
index a65d19f..abc2a1a 100644
--- a/media/ffmpeg/ffmpeg_common.cc
+++ b/media/ffmpeg/ffmpeg_common.cc
@@ -298,6 +298,12 @@ static void AVCodecContextToAudioDecoderConfig(
codec_context->seek_preroll * 1000000.0 / codec_context->sample_rate);
}
+ base::TimeDelta codec_delay;
+ if (codec_context->delay > 0) {
+ codec_delay = base::TimeDelta::FromMicroseconds(
+ codec_context->delay * 1000000.0 / codec_context->sample_rate);
+ }
+
config->Initialize(codec,
sample_format,
channel_layout,
@@ -307,7 +313,7 @@ static void AVCodecContextToAudioDecoderConfig(
is_encrypted,
record_stats,
seek_preroll,
- codec_context->delay);
+ codec_delay);
if (codec != kCodecOpus) {
DCHECK_EQ(av_get_bytes_per_sample(codec_context->sample_fmt) * 8,
config->bits_per_channel());