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

Unified Diff: media/webm/webm_cluster_parser.cc

Issue 10803019: Chrome-side implementation of media source timestamp offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move logic from parser to demuxer 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
Index: media/webm/webm_cluster_parser.cc
diff --git a/media/webm/webm_cluster_parser.cc b/media/webm/webm_cluster_parser.cc
index c5a2fdc598237800758df3d8e88acdefc914cff4..13854a0958eacdccc451270b947529eb408b12f2 100644
--- a/media/webm/webm_cluster_parser.cc
+++ b/media/webm/webm_cluster_parser.cc
@@ -24,6 +24,7 @@ WebMClusterParser::WebMClusterParser(int64 timecode_scale,
block_duration_(-1),
cluster_timecode_(-1),
cluster_start_time_(kNoTimestamp()),
+ cluster_ended_(false),
audio_(audio_track_num),
video_(video_track_num) {
CHECK_GE(video_encryption_key_id_size, 0);
@@ -51,10 +52,13 @@ int WebMClusterParser::Parse(const uint8* buf, int size) {
int result = parser_.Parse(buf, size);
- if (result <= 0)
+ if (result <= 0) {
+ cluster_ended_ = false;
return result;
+ }
- if (parser_.IsParsingComplete()) {
+ cluster_ended_ = parser_.IsParsingComplete();
+ if (cluster_ended_) {
// If there were no buffers in this cluster, set the cluster start time to
// be the |cluster_timecode_|.
if (cluster_start_time_ == kNoTimestamp()) {

Powered by Google App Engine
This is Rietveld 408576698