Chromium Code Reviews| 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/mp2t/es_parser_adts.h" | 5 #include "media/formats/mp2t/es_parser_adts.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 133 if (!UpdateAudioConfiguration(adts_frame.data)) | 133 if (!UpdateAudioConfiguration(adts_frame.data)) |
| 134 return false; | 134 return false; |
| 135 | 135 |
| 136 // Get the PTS & the duration of this access unit. | 136 // Get the PTS & the duration of this access unit. |
| 137 TimingDesc current_timing_desc = | 137 TimingDesc current_timing_desc = |
| 138 GetTimingDescriptor(adts_frame.queue_offset); | 138 GetTimingDescriptor(adts_frame.queue_offset); |
| 139 if (current_timing_desc.pts != kNoTimestamp()) | 139 if (current_timing_desc.pts != kNoTimestamp()) |
| 140 audio_timestamp_helper_->SetBaseTimestamp(current_timing_desc.pts); | 140 audio_timestamp_helper_->SetBaseTimestamp(current_timing_desc.pts); |
| 141 | 141 |
| 142 if (audio_timestamp_helper_->base_timestamp() == kNoTimestamp()) { | 142 if (audio_timestamp_helper_->base_timestamp() == kNoTimestamp()) { |
| 143 DVLOG(1) << "Audio frame with unknown timestamp"; | 143 DVLOG(1) << "Skipped audio frame with unknown timestamp"; |
|
damienv1
2014/10/09 18:29:09
nit: would prefer the present. "Skip audio frame..
servolk
2014/10/09 18:53:04
Done.
| |
| 144 return false; | 144 SkipAdtsFrame(adts_frame); |
|
damienv1
2014/10/09 18:29:09
Could you update the unit test as well ?
servolk
2014/10/09 18:53:04
Done.
| |
| 145 continue; | |
|
damienv1
2014/10/09 18:29:09
To be consistent, you should do the same for the M
servolk
2014/10/09 18:53:03
Done.
| |
| 145 } | 146 } |
| 146 base::TimeDelta current_pts = audio_timestamp_helper_->GetTimestamp(); | 147 base::TimeDelta current_pts = audio_timestamp_helper_->GetTimestamp(); |
| 147 base::TimeDelta frame_duration = | 148 base::TimeDelta frame_duration = |
| 148 audio_timestamp_helper_->GetFrameDuration(kSamplesPerAACFrame); | 149 audio_timestamp_helper_->GetFrameDuration(kSamplesPerAACFrame); |
| 149 | 150 |
| 150 // Emit an audio frame. | 151 // Emit an audio frame. |
| 151 bool is_key_frame = true; | 152 bool is_key_frame = true; |
| 152 | 153 |
| 153 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId | 154 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId |
| 154 // type and allow multiple audio tracks. See https://crbug.com/341581. | 155 // type and allow multiple audio tracks. See https://crbug.com/341581. |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 // Audio config notification. | 252 // Audio config notification. |
| 252 last_audio_decoder_config_ = audio_decoder_config; | 253 last_audio_decoder_config_ = audio_decoder_config; |
| 253 new_audio_config_cb_.Run(audio_decoder_config); | 254 new_audio_config_cb_.Run(audio_decoder_config); |
| 254 } | 255 } |
| 255 | 256 |
| 256 return true; | 257 return true; |
| 257 } | 258 } |
| 258 | 259 |
| 259 } // namespace mp2t | 260 } // namespace mp2t |
| 260 } // namespace media | 261 } // namespace media |
| OLD | NEW |