| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 214 |
| 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 std::unique_ptr<MediaTracks> media_tracks(new MediaTracks()); | 222 std::unique_ptr<MediaTracks> media_tracks(new MediaTracks()); |
| 223 if (config_.IsValidConfig()) { | 223 if (config_.IsValidConfig()) { |
| 224 media_tracks->AddAudioTrack(config_, "audio", "", "", ""); | 224 media_tracks->AddAudioTrack(config_, 1, "main", "", ""); |
| 225 } | 225 } |
| 226 if (!config_cb_.Run(std::move(media_tracks), TextTrackConfigMap())) | 226 if (!config_cb_.Run(std::move(media_tracks), TextTrackConfigMap())) |
| 227 return -1; | 227 return -1; |
| 228 | 228 |
| 229 if (!init_cb_.is_null()) { | 229 if (!init_cb_.is_null()) { |
| 230 InitParameters params(kInfiniteDuration()); | 230 InitParameters params(kInfiniteDuration()); |
| 231 params.detected_audio_track_count = 1; | 231 params.detected_audio_track_count = 1; |
| 232 params.auto_update_timestamp_offset = true; | 232 params.auto_update_timestamp_offset = true; |
| 233 base::ResetAndReturn(&init_cb_).Run(params); | 233 base::ResetAndReturn(&init_cb_).Run(params); |
| 234 } | 234 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 if (end_of_segment) { | 415 if (end_of_segment) { |
| 416 in_media_segment_ = false; | 416 in_media_segment_ = false; |
| 417 end_of_segment_cb_.Run(); | 417 end_of_segment_cb_.Run(); |
| 418 } | 418 } |
| 419 | 419 |
| 420 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); | 420 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); |
| 421 return true; | 421 return true; |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace media | 424 } // namespace media |
| OLD | NEW |