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

Unified Diff: media/formats/mpeg/mpeg_audio_stream_parser_base.cc

Issue 239423005: Wire up codec_delay() to MP3StreamParser and FFmpegAudioDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « media/formats/mpeg/mpeg_audio_stream_parser_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698