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

Unified Diff: media/mp4/mp4_stream_parser.cc

Issue 10660005: Flush sample buffers when reading new segments in Media Source BMFF parser. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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 | media/mp4/mp4_stream_parser_unittest.cc » ('j') | 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 4f4a6db12818e03483bb2cfd59f884b4d94714b2..e16d81d879e9aafa70bcaa66c6e6de9c958efbaf 100644
--- a/media/mp4/mp4_stream_parser.cc
+++ b/media/mp4/mp4_stream_parser.cc
@@ -76,6 +76,19 @@ bool MP4StreamParser::Parse(const uint8* buf, int size) {
do {
if (state_ == kParsingBoxes) {
+ // Flush any buffers we've gotten in this chunk so that buffers don't
acolwell GONE FROM CHROMIUM 2012/06/25 21:22:16 It might be clearer to place this logic in Enqueue
strobe_ 2012/06/26 00:37:59 Done.
+ // cross NewSegment() calls
+ if (!audio_buffers.empty()) {
acolwell GONE FROM CHROMIUM 2012/06/25 21:22:16 This isn't sufficient. You need to do all the same
strobe_ 2012/06/26 00:37:59 What checks are missing here as compared to below?
acolwell GONE FROM CHROMIUM 2012/06/26 15:25:14 Sorry. The CHECK/DCHECK here was actually inapprop
+ CHECK(!audio_cb_.is_null());
acolwell GONE FROM CHROMIUM 2012/06/25 21:22:16 Use DCHECK here and below. Let the null pointer ex
strobe_ 2012/06/26 00:37:59 Done. (well, moved into the shared error condition
+ RCHECK(audio_cb_.Run(audio_buffers));
+ audio_buffers.clear();
+ }
+ if (!video_buffers.empty()) {
+ CHECK(!video_cb_.is_null());
+ RCHECK(video_cb_.Run(video_buffers));
+ video_buffers.clear();
+ }
+
if (mdat_tail_ > queue_.head()) {
result = queue_.Trim(mdat_tail_);
} else {
« no previous file with comments | « no previous file | media/mp4/mp4_stream_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698