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

Unified Diff: media/webm/webm_stream_parser.cc

Issue 10696182: Add config change handling to SourceBufferStream & ChunkDemuxer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added copyright headers to manifest files Created 8 years, 5 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/webm/webm_info_parser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/webm/webm_stream_parser.cc
diff --git a/media/webm/webm_stream_parser.cc b/media/webm/webm_stream_parser.cc
index d141bfdd1525cb24cc7a232c62c5487e8d1750f8..e9c8233e281e05be5ca53384c2394fab671d5d82 100644
--- a/media/webm/webm_stream_parser.cc
+++ b/media/webm/webm_stream_parser.cc
@@ -235,7 +235,8 @@ bool WebMStreamParser::Parse(const uint8* buf, int size) {
int cur_size = 0;
byte_queue_.Peek(&cur, &cur_size);
- do {
+ while (cur_size > 0) {
+ State oldState = state_;
switch (state_) {
case kParsingHeaders:
result = ParseInfoAndTracks(cur, cur_size);
@@ -255,10 +256,14 @@ bool WebMStreamParser::Parse(const uint8* buf, int size) {
return false;
}
+ if (state_ == oldState && result == 0)
+ break;
+
+ DCHECK_GE(result, 0);
cur += result;
cur_size -= result;
bytes_parsed += result;
- } while (result > 0 && cur_size > 0);
+ }
byte_queue_.Pop(bytes_parsed);
return true;
« no previous file with comments | « media/webm/webm_info_parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698