From 72b69885167e1ee75946d76a052d3379c4d6558f Mon Sep 17 00:00:00 2001 From: Thomas Inskip Date: Tue, 1 Jul 2014 16:15:59 -0700 Subject: [PATCH] Change to allow receiving PPS before SPS. Change-Id: I9c5a62a9b8948420cd45be39805a60db128964ac --- media/formats/mp2t/es_parser_h264.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/media/formats/mp2t/es_parser_h264.cc b/media/formats/mp2t/es_parser_h264.cc index 0b17d76e6c..bb0f449539 100644 --- a/media/formats/mp2t/es_parser_h264.cc +++ b/media/formats/mp2t/es_parser_h264.cc @@ -209,9 +209,13 @@ bool EsParserH264::ParseInternal() { case H264NALU::kPPS: { DVLOG(LOG_LEVEL_ES) << "NALU: PPS"; int pps_id; - if (h264_parser_->ParsePPS(&pps_id) != H264Parser::kOk) - return false; - decoder_config_check_pending_ = true; + if (h264_parser_->ParsePPS(&pps_id) != H264Parser::kOk) { + // Allow PPS parsing to fail if waiting for SPS. + if (last_video_decoder_config_) + return false; + } else { + decoder_config_check_pending_ = true; + } break; } case H264NALU::kIDRSlice: