Support WVM indexes which span multiple PES packets.

Change-Id: Iffb68e97f2613ebbc4e12d4226bed388bc444e76
This commit is contained in:
Thomas Inskip 2014-12-03 15:33:16 -08:00
parent fedf9b4233
commit 2d3927e7cb
1 changed files with 6 additions and 4 deletions

View File

@ -429,8 +429,6 @@ bool WvmMediaParser::Parse(const uint8_t* buf, int size) {
if (!ParseIndexEntry()) { if (!ParseIndexEntry()) {
return false; return false;
} }
index_program_id_++;
index_data_.clear();
} }
} }
read_ptr += num_bytes; read_ptr += num_bytes;
@ -553,7 +551,8 @@ bool WvmMediaParser::ParseIndexEntry() {
if (version == kVersion4) { if (version == kVersion4) {
index_size = kIndexVersion4HeaderSize + ntohlFromBuffer(read_ptr_index); index_size = kIndexVersion4HeaderSize + ntohlFromBuffer(read_ptr_index);
if (index_data_.size() < index_size) { if (index_data_.size() < index_size) {
return false; // We do not yet have the full index. Keep accumulating index data.
return true;
} }
read_ptr_index += sizeof(uint32_t); read_ptr_index += sizeof(uint32_t);
@ -723,6 +722,9 @@ bool WvmMediaParser::ParseIndexEntry() {
stream_id_count_++; stream_id_count_++;
} }
} }
index_program_id_++;
index_data_.clear();
return true; return true;
} }