Chromium Code Reviews| Index: media/formats/mpeg/mpeg_audio_stream_parser_base.cc |
| diff --git a/media/formats/mpeg/mpeg_audio_stream_parser_base.cc b/media/formats/mpeg/mpeg_audio_stream_parser_base.cc |
| index aaf6a50bb39d62b851e01ed74f9737b054245479..4f40e9b94159383d6599b9120b9ca77055ca79a9 100644 |
| --- a/media/formats/mpeg/mpeg_audio_stream_parser_base.cc |
| +++ b/media/formats/mpeg/mpeg_audio_stream_parser_base.cc |
| @@ -44,11 +44,13 @@ static int LocateEndOfHeaders(const uint8_t* buf, int buf_len, int i) { |
| } |
| MPEGAudioStreamParserBase::MPEGAudioStreamParserBase(uint32 start_code_mask, |
| - AudioCodec audio_codec) |
| + AudioCodec audio_codec, |
| + int codec_delay_in_frames) |
| : state_(UNINITIALIZED), |
| in_media_segment_(false), |
| start_code_mask_(start_code_mask), |
| - audio_codec_(audio_codec) {} |
| + audio_codec_(audio_codec), |
| + codec_delay_in_frames_(codec_delay_in_frames) {} |
| MPEGAudioStreamParserBase::~MPEGAudioStreamParserBase() {} |
| @@ -193,10 +195,6 @@ int MPEGAudioStreamParserBase::ParseFrame(const uint8* data, |
| } |
| if (!config_.IsValidConfig()) { |
| - config_.Initialize(audio_codec_, kSampleFormatF32, channel_layout, |
| - sample_rate, NULL, 0, false, false, |
| - base::TimeDelta(), base::TimeDelta()); |
| - |
| base::TimeDelta base_timestamp; |
| if (timestamp_helper_) |
| base_timestamp = timestamp_helper_->GetTimestamp(); |
| @@ -204,6 +202,18 @@ int MPEGAudioStreamParserBase::ParseFrame(const uint8* data, |
| timestamp_helper_.reset(new AudioTimestampHelper(sample_rate)); |
| timestamp_helper_->SetBaseTimestamp(base_timestamp); |
| + config_.Initialize( |
| + audio_codec_, |
| + kSampleFormatF32, |
| + channel_layout, |
| + sample_rate, |
| + NULL, |
| + 0, |
| + false, |
| + false, |
| + base::TimeDelta(), |
| + timestamp_helper_->GetFrameDuration(codec_delay_in_frames_)); |
|
DaleCurtis
2014/04/15 22:22:26
I'm wondering if we should just change codec_delay
acolwell GONE FROM CHROMIUM
2014/04/16 15:47:35
Yes. I think the coding_delay should be in frames
DaleCurtis
2014/04/16 18:22:22
Do you have a preference in naming? Keep codec_del
|
| + |
| VideoDecoderConfig video_config; |
| bool success = config_cb_.Run(config_, video_config, TextTrackConfigMap()); |