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

Side by Side Diff: media/webm/webm_cluster_parser.cc

Issue 10823156: Fix live bug & renable ChunkDemuxerTest.TestWebMFile_LiveAudioAndVideo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/webm/webm_cluster_parser.h" 5 #include "media/webm/webm_cluster_parser.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/sys_byteorder.h" 10 #include "base/sys_byteorder.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 audio_.Reset(); 51 audio_.Reset();
52 video_.Reset(); 52 video_.Reset();
53 } 53 }
54 54
55 int WebMClusterParser::Parse(const uint8* buf, int size) { 55 int WebMClusterParser::Parse(const uint8* buf, int size) {
56 audio_.Reset(); 56 audio_.Reset();
57 video_.Reset(); 57 video_.Reset();
58 58
59 int result = parser_.Parse(buf, size); 59 int result = parser_.Parse(buf, size);
60 60
61 if (result <= 0) { 61 if (result < 0) {
62 cluster_ended_ = false; 62 cluster_ended_ = false;
63 return result; 63 return result;
64 } 64 }
65 65
66 cluster_ended_ = parser_.IsParsingComplete(); 66 cluster_ended_ = parser_.IsParsingComplete();
67 if (cluster_ended_) { 67 if (cluster_ended_) {
68 // If there were no buffers in this cluster, set the cluster start time to 68 // If there were no buffers in this cluster, set the cluster start time to
69 // be the |cluster_timecode_|. 69 // be the |cluster_timecode_|.
70 if (cluster_start_time_ == kNoTimestamp()) { 70 if (cluster_start_time_ == kNoTimestamp()) {
71 DCHECK_GT(cluster_timecode_, -1); 71 DCHECK_GT(cluster_timecode_, -1);
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 282
283 buffers_.push_back(buffer); 283 buffers_.push_back(buffer);
284 return true; 284 return true;
285 } 285 }
286 286
287 void WebMClusterParser::Track::Reset() { 287 void WebMClusterParser::Track::Reset() {
288 buffers_.clear(); 288 buffers_.clear();
289 } 289 }
290 290
291 } // namespace media 291 } // namespace media
OLDNEW
« media/filters/chunk_demuxer_unittest.cc ('K') | « media/filters/chunk_demuxer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698