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

Side by Side Diff: media/formats/webm/webm_info_parser.cc

Issue 2090323002: Make callers of FromUTC(Local)Exploded in media/ use new time API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 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 unified diff | Download patch
« no previous file with comments | « media/ffmpeg/ffmpeg_common.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « media/ffmpeg/ffmpeg_common.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698