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

Unified Diff: media/formats/mp2t/es_parser_adts.cc

Issue 399433003: Mpeg2 TS - Fail when no valid timestamp in the ADTS parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix rebase: do not set dts in adts parser. Created 6 years, 4 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/mp2t/es_parser_adts.h ('k') | media/formats/mp2t/es_parser_adts_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp2t/es_parser_adts.cc
diff --git a/media/formats/mp2t/es_parser_adts.cc b/media/formats/mp2t/es_parser_adts.cc
index 08a54c437dd820f67c17bcdce57f4359af4432e9..f2a284a2004587c6a660009cd34efb878a1c0f2c 100644
--- a/media/formats/mp2t/es_parser_adts.cc
+++ b/media/formats/mp2t/es_parser_adts.cc
@@ -151,6 +151,10 @@ bool EsParserAdts::Parse(const uint8* buf, int size,
pts_list_.pop_front();
}
+ if (audio_timestamp_helper_->base_timestamp() == kNoTimestamp()) {
+ DVLOG(1) << "Audio frame with unknown timestamp";
+ return false;
+ }
base::TimeDelta current_pts = audio_timestamp_helper_->GetTimestamp();
base::TimeDelta frame_duration =
audio_timestamp_helper_->GetFrameDuration(kSamplesPerAACFrame);
@@ -246,7 +250,8 @@ bool EsParserAdts::UpdateAudioConfiguration(const uint8* adts_header) {
DVLOG(1) << "Channel config: " << channel_configuration;
DVLOG(1) << "Adts profile: " << adts_profile;
// Reset the timestamp helper to use a new time scale.
- if (audio_timestamp_helper_) {
+ if (audio_timestamp_helper_ &&
+ audio_timestamp_helper_->base_timestamp() != kNoTimestamp()) {
base::TimeDelta base_timestamp = audio_timestamp_helper_->GetTimestamp();
audio_timestamp_helper_.reset(
new AudioTimestampHelper(samples_per_second));
« no previous file with comments | « media/formats/mp2t/es_parser_adts.h ('k') | media/formats/mp2t/es_parser_adts_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698