| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/ffmpeg/ffmpeg_util.h" | 5 #include "media/ffmpeg/ffmpeg_util.h" |
| 6 | 6 |
| 7 #include "media/filters/ffmpeg_common.h" | 7 #include "media/ffmpeg/ffmpeg_common.h" |
| 8 | 8 |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| 11 static const AVRational kMicrosBase = { 1, base::Time::kMicrosecondsPerSecond }; | 11 static const AVRational kMicrosBase = { 1, base::Time::kMicrosecondsPerSecond }; |
| 12 | 12 |
| 13 base::TimeDelta ConvertTimestamp(const AVRational& time_base, int64 timestamp) { | 13 base::TimeDelta ConvertTimestamp(const AVRational& time_base, int64 timestamp) { |
| 14 int64 microseconds = av_rescale_q(timestamp, time_base, kMicrosBase); | 14 int64 microseconds = av_rescale_q(timestamp, time_base, kMicrosBase); |
| 15 return base::TimeDelta::FromMicroseconds(microseconds); | 15 return base::TimeDelta::FromMicroseconds(microseconds); |
| 16 } | 16 } |
| 17 | 17 |
| 18 } // namespace media | 18 } // namespace media |
| OLD | NEW |