| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/formats/mpeg/mpeg_audio_stream_parser_base.h" | 5 #include "media/formats/mpeg/mpeg_audio_stream_parser_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "media/base/buffers.h" | 10 #include "media/base/buffers.h" |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 base::TimeDelta base_timestamp; | 215 base::TimeDelta base_timestamp; |
| 216 if (timestamp_helper_) | 216 if (timestamp_helper_) |
| 217 base_timestamp = timestamp_helper_->GetTimestamp(); | 217 base_timestamp = timestamp_helper_->GetTimestamp(); |
| 218 | 218 |
| 219 timestamp_helper_.reset(new AudioTimestampHelper(sample_rate)); | 219 timestamp_helper_.reset(new AudioTimestampHelper(sample_rate)); |
| 220 timestamp_helper_->SetBaseTimestamp(base_timestamp); | 220 timestamp_helper_->SetBaseTimestamp(base_timestamp); |
| 221 | 221 |
| 222 VideoDecoderConfig video_config; | 222 VideoDecoderConfig video_config; |
| 223 bool success = config_cb_.Run(config_, video_config, TextTrackConfigMap()); | 223 bool success = config_cb_.Run(config_, video_config, TextTrackConfigMap()); |
| 224 | 224 |
| 225 if (!init_cb_.is_null()) | 225 if (!init_cb_.is_null()) { |
| 226 base::ResetAndReturn(&init_cb_).Run( | 226 InitParameters params(kInfiniteDuration()); |
| 227 success, kInfiniteDuration(), base::Time(), true); | 227 params.auto_update_timestamp_offset = true; |
| 228 base::ResetAndReturn(&init_cb_).Run(success, params); |
| 229 } |
| 228 | 230 |
| 229 if (!success) | 231 if (!success) |
| 230 return -1; | 232 return -1; |
| 231 } | 233 } |
| 232 | 234 |
| 233 if (metadata_frame) | 235 if (metadata_frame) |
| 234 return frame_size; | 236 return frame_size; |
| 235 | 237 |
| 236 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId | 238 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId |
| 237 // type and allow multiple audio tracks, if applicable. See | 239 // type and allow multiple audio tracks, if applicable. See |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 if (end_of_segment) { | 412 if (end_of_segment) { |
| 411 in_media_segment_ = false; | 413 in_media_segment_ = false; |
| 412 end_of_segment_cb_.Run(); | 414 end_of_segment_cb_.Run(); |
| 413 } | 415 } |
| 414 | 416 |
| 415 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); | 417 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); |
| 416 return true; | 418 return true; |
| 417 } | 419 } |
| 418 | 420 |
| 419 } // namespace media | 421 } // namespace media |
| OLD | NEW |