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

Unified Diff: media/mp2t/es_parser_h264.cc

Issue 136703005: Return an error on Multiple AUs in a PES. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed extra blank line as per review comment. Created 6 years, 11 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
« media/mp2t/es_parser_h264.h ('K') | « media/mp2t/es_parser_h264.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mp2t/es_parser_h264.cc
diff --git a/media/mp2t/es_parser_h264.cc b/media/mp2t/es_parser_h264.cc
index 48519c786fc46c66202d298726fbab990eefdf0f..bb75106e2b8f9fa7c2f77d5bba75df544e41f2fe 100644
--- a/media/mp2t/es_parser_h264.cc
+++ b/media/mp2t/es_parser_h264.cc
@@ -216,7 +216,7 @@ bool EsParserH264::ParseInternal() {
// Emit a frame if needed.
if (nal_unit_type == kNalUnitTypeAUD)
- EmitFrameIfNeeded(es_pos_);
+ RCHECK(EmitFrameIfNeeded(es_pos_));
// Skip the syncword.
es_pos_ += syncword_length;
@@ -225,21 +225,24 @@ bool EsParserH264::ParseInternal() {
return true;
}
-void EsParserH264::EmitFrameIfNeeded(int next_aud_pos) {
+bool EsParserH264::EmitFrameIfNeeded(int next_aud_pos) {
// There is no current frame: start a new frame.
if (current_access_unit_pos_ < 0) {
StartFrame(next_aud_pos);
- return;
+ return true;
}
// Get the access unit timing info.
- TimingDesc current_timing_desc;
+ TimingDesc current_timing_desc = {kNoTimestamp(), kNoTimestamp()};
while (!timing_desc_list_.empty() &&
timing_desc_list_.front().first <= current_access_unit_pos_) {
current_timing_desc = timing_desc_list_.front().second;
timing_desc_list_.pop_front();
}
+ if (current_timing_desc.pts == kNoTimestamp())
+ return false;
+
// Emit a frame.
int raw_es_size;
const uint8* raw_es;
@@ -256,6 +259,7 @@ void EsParserH264::EmitFrameIfNeeded(int next_aud_pos) {
// Set the current frame position to the next AUD position.
StartFrame(next_aud_pos);
+ return true;
}
void EsParserH264::StartFrame(int aud_pos) {
« media/mp2t/es_parser_h264.h ('K') | « media/mp2t/es_parser_h264.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698