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

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: 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
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 433baabe5e674017fcbb2b150fcaefb9006d0a37..cad9a5934294e1884137feea19b1f46eeaaeb26e 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();
wolenetz 2014/08/14 18:46:29 nit: I prefer a blank line between } and non-}.
damienv1 2014/08/14 22:31:22 I usually put code in logical groups: here we real
wolenetz 2014/08/14 23:13:53 Acknowledged.
base::TimeDelta frame_duration =
audio_timestamp_helper_->GetFrameDuration(kSamplesPerAACFrame);
@@ -247,7 +251,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));

Powered by Google App Engine
This is Rietveld 408576698