OLD | NEW |
---|---|
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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/base/data_buffer.h" | 8 #include "media/base/data_buffer.h" |
9 #include "media/webm/webm_constants.h" | 9 #include "media/webm/webm_constants.h" |
10 | 10 |
11 namespace media { | 11 namespace media { |
12 | 12 |
13 static Buffer* CreateBuffer(const uint8* data, size_t size) { | 13 static Buffer* CreateBuffer(const uint8* data, size_t size) { |
14 scoped_array<uint8> buf(new uint8[size]); | 14 int extra_bytes = 16; |
Ami GONE FROM CHROMIUM
2012/01/27 23:44:58
Commentary?
acolwell GONE FROM CHROMIUM
2012/01/29 03:00:41
Changed to FF_INPUT_BUFFER_PADDING_SIZE & added a
| |
15 scoped_array<uint8> buf(new uint8[size + extra_bytes]); | |
15 memcpy(buf.get(), data, size); | 16 memcpy(buf.get(), data, size); |
17 memset(buf.get() + size, 0, extra_bytes); | |
16 return new DataBuffer(buf.Pass(), size); | 18 return new DataBuffer(buf.Pass(), size); |
17 } | 19 } |
18 | 20 |
19 WebMClusterParser::WebMClusterParser(int64 timecode_scale, | 21 WebMClusterParser::WebMClusterParser(int64 timecode_scale, |
20 int audio_track_num, | 22 int audio_track_num, |
21 base::TimeDelta audio_default_duration, | 23 base::TimeDelta audio_default_duration, |
22 int video_track_num, | 24 int video_track_num, |
23 base::TimeDelta video_default_duration) | 25 base::TimeDelta video_default_duration) |
24 : timecode_multiplier_(timecode_scale / 1000.0), | 26 : timecode_multiplier_(timecode_scale / 1000.0), |
25 audio_track_num_(audio_track_num), | 27 audio_track_num_(audio_track_num), |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 buffer->SetDuration(video_default_duration_); | 124 buffer->SetDuration(video_default_duration_); |
123 queue = &video_buffers_; | 125 queue = &video_buffers_; |
124 } else { | 126 } else { |
125 DVLOG(1) << "Unexpected track number " << track_num; | 127 DVLOG(1) << "Unexpected track number " << track_num; |
126 return false; | 128 return false; |
127 } | 129 } |
128 | 130 |
129 if (!queue->empty() && | 131 if (!queue->empty() && |
130 buffer->GetTimestamp() == queue->back()->GetTimestamp()) { | 132 buffer->GetTimestamp() == queue->back()->GetTimestamp()) { |
131 DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically " | 133 DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically " |
132 << "increasing for track " << track_num; | 134 << "increasing for track " << track_num; |
133 return false; | 135 return false; |
134 } | 136 } |
135 | 137 |
136 queue->push_back(buffer); | 138 queue->push_back(buffer); |
137 return true; | 139 return true; |
138 } | 140 } |
139 | 141 |
140 } // namespace media | 142 } // namespace media |
OLD | NEW |