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

Side by Side Diff: media/formats/mp2t/es_parser_adts.cc

Issue 646673002: Skip audio frames with unknown timestamp in MPEG2TS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed also mpeg1 parser and updated unit tests Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/formats/mp2t/es_parser_adts_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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) << "Skip audio frame with unknown timestamp";
wolenetz 2014/10/09 19:12:46 nit: s/Skip/Skipping/ :) (and ditto in the mpeg1au
servolk 2014/10/09 20:14:11 Done.
144 return false; 144 SkipAdtsFrame(adts_frame);
145 continue;
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
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
OLDNEW
« no previous file with comments | « no previous file | media/formats/mp2t/es_parser_adts_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698