OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/formats/webm/webm_info_parser.h" | 5 #include "media/formats/webm/webm_info_parser.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/formats/webm/webm_constants.h" | 8 #include "media/formats/webm/webm_constants.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 return false; | 79 return false; |
80 | 80 |
81 int64_t date_in_nanoseconds = 0; | 81 int64_t date_in_nanoseconds = 0; |
82 for (int i = 0; i < size; ++i) | 82 for (int i = 0; i < size; ++i) |
83 date_in_nanoseconds = (date_in_nanoseconds << 8) | data[i]; | 83 date_in_nanoseconds = (date_in_nanoseconds << 8) | data[i]; |
84 | 84 |
85 base::Time::Exploded exploded_epoch; | 85 base::Time::Exploded exploded_epoch; |
86 exploded_epoch.year = 2001; | 86 exploded_epoch.year = 2001; |
87 exploded_epoch.month = 1; | 87 exploded_epoch.month = 1; |
88 exploded_epoch.day_of_month = 1; | 88 exploded_epoch.day_of_month = 1; |
| 89 exploded_epoch.day_of_week = 1; |
89 exploded_epoch.hour = 0; | 90 exploded_epoch.hour = 0; |
90 exploded_epoch.minute = 0; | 91 exploded_epoch.minute = 0; |
91 exploded_epoch.second = 0; | 92 exploded_epoch.second = 0; |
92 exploded_epoch.millisecond = 0; | 93 exploded_epoch.millisecond = 0; |
93 base::Time out_time; | 94 base::Time out_time; |
94 if (!base::Time::FromUTCExploded(exploded_epoch, &out_time)) | 95 if (!base::Time::FromUTCExploded(exploded_epoch, &out_time)) |
95 return false; | 96 return false; |
96 date_utc_ = out_time + | 97 date_utc_ = out_time + |
97 base::TimeDelta::FromMicroseconds(date_in_nanoseconds / 1000); | 98 base::TimeDelta::FromMicroseconds(date_in_nanoseconds / 1000); |
98 } | 99 } |
99 return true; | 100 return true; |
100 } | 101 } |
101 | 102 |
102 bool WebMInfoParser::OnString(int id, const std::string& str) { | 103 bool WebMInfoParser::OnString(int id, const std::string& str) { |
103 return true; | 104 return true; |
104 } | 105 } |
105 | 106 |
106 } // namespace media | 107 } // namespace media |
OLD | NEW |