Chromium Code Reviews| 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; |