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

Unified Diff: media/filters/source_buffer_stream.cc

Issue 1692403002: MSE - Fix crash caused by incorrect GC of GOP with next buffer position (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stick with DCHECKs for this to ease merging. +unit test Created 4 years, 10 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
Index: media/filters/source_buffer_stream.cc
diff --git a/media/filters/source_buffer_stream.cc b/media/filters/source_buffer_stream.cc
index 619ff47ab7d4c54a1dcc070384c3ab0bfcfe5c70..8187fa90ecfb297b7599699460594f6e7eb820a9 100644
--- a/media/filters/source_buffer_stream.cc
+++ b/media/filters/source_buffer_stream.cc
@@ -730,7 +730,7 @@ bool SourceBufferStream::GarbageCollectIfNeeded(DecodeTimestamp media_time,
if (bytes_freed < bytes_to_free) {
size_t front2 = FreeBuffers(bytes_to_free - bytes_freed,
ranges_.back()->GetEndTimestamp(), false);
- DVLOG(3) << __FUNCTION__ << " Removed " << front << " bytes from the"
+ DVLOG(3) << __FUNCTION__ << " Removed " << front2 << " bytes from the"
<< " front. ranges_=" << RangesToString(ranges_);
bytes_freed += front2;
}
@@ -855,13 +855,17 @@ size_t SourceBufferStream::FreeBuffers(size_t total_bytes_to_free,
} else {
current_range = ranges_.front();
DVLOG(5) << "current_range=" << RangeToString(*current_range);
- if (!current_range->FirstGOPEarlierThanMediaTime(media_time)) {
+ if (!current_range->FirstGOPEarlierThanMediaTime(media_time) ||
+ current_range->FirstGOPContainsNextBufferPosition()) {
wolenetz 2016/02/13 01:35:07 This is the core of the fix...
servolk 2016/02/16 19:28:38 Have you been able to figure out exactly how this
wolenetz 2016/02/16 20:12:47 Yes. I've confirmed at least one way this happens
servolk 2016/02/16 23:11:24 ok, but this requires seeking to a very precise po
chcunningham 2016/02/16 23:36:25 After chatting f2f we settled on doing the "altern
wolenetz 2016/02/16 23:37:55 Acknowledged. Unfortunately, I have been hitting t
// We have removed all data up to the GOP that contains current playback
// position, we can't delete any further.
DVLOG(5) << "current_range contains playback position, stopping GC";
break;
}
- DVLOG(4) << "Deleting GOP from front: " << RangeToString(*current_range);
+ DVLOG(4) << "Deleting GOP from front: " << RangeToString(*current_range)
+ << ", media_time: " << media_time.InMicroseconds()
+ << ", current_range->HasNextBufferPosition(): "
+ << current_range->HasNextBufferPosition();
bytes_deleted = current_range->DeleteGOPFromFront(&buffers);
}

Powered by Google App Engine
This is Rietveld 408576698