| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.hour = 0; | 89 exploded_epoch.hour = 0; |
| 90 exploded_epoch.minute = 0; | 90 exploded_epoch.minute = 0; |
| 91 exploded_epoch.second = 0; | 91 exploded_epoch.second = 0; |
| 92 exploded_epoch.millisecond = 0; | 92 exploded_epoch.millisecond = 0; |
| 93 date_utc_ = base::Time::FromUTCExploded(exploded_epoch) + | 93 base::Time out_time; |
| 94 base::TimeDelta::FromMicroseconds(date_in_nanoseconds / 1000); | 94 if (!base::Time::FromUTCExploded(exploded_epoch, &out_time)) |
| 95 return false; |
| 96 date_utc_ = out_time + |
| 97 base::TimeDelta::FromMicroseconds(date_in_nanoseconds / 1000); |
| 95 } | 98 } |
| 96 return true; | 99 return true; |
| 97 } | 100 } |
| 98 | 101 |
| 99 bool WebMInfoParser::OnString(int id, const std::string& str) { | 102 bool WebMInfoParser::OnString(int id, const std::string& str) { |
| 100 return true; | 103 return true; |
| 101 } | 104 } |
| 102 | 105 |
| 103 } // namespace media | 106 } // namespace media |
| OLD | NEW |