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

Unified Diff: media/mp4/mp4_stream_parser.cc

Issue 10821081: Move 'mdat' advancement logic to make more sense. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix all the grammars 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mp4/mp4_stream_parser.cc
diff --git a/media/mp4/mp4_stream_parser.cc b/media/mp4/mp4_stream_parser.cc
index 9d51959a3a32bbc8d45c0c4db8370c80e1093737..f5080df451a1fd80d53d3bac17d8db9e6a3035f4 100644
--- a/media/mp4/mp4_stream_parser.cc
+++ b/media/mp4/mp4_stream_parser.cc
@@ -80,11 +80,7 @@ bool MP4StreamParser::Parse(const uint8* buf, int size) {
do {
if (state_ == kParsingBoxes) {
- if (mdat_tail_ > queue_.head()) {
- result = queue_.Trim(mdat_tail_);
- } else {
- result = ParseBox(&err);
- }
+ result = ParseBox(&err);
} else {
DCHECK_EQ(kEmittingSamples, state_);
result = EnqueueSample(&audio_buffers, &video_buffers, &err);
@@ -322,6 +318,10 @@ bool MP4StreamParser::EnqueueSample(BufferQueue* audio_buffers,
if (*err)
return false;
+ // Remain in kEnqueueingSamples state, discarding data, until the end of
+ // the current 'mdat' box has been appended to the queue.
+ if (!queue_.Trim(mdat_tail_)) return false;
acolwell GONE FROM CHROMIUM 2012/07/30 15:45:50 nit: Put return on its own line.
strobe_ 2012/07/30 16:33:38 Done.
+
ChangeState(kParsingBoxes);
end_of_segment_cb_.Run();
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698