summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/libjingle/source/talk/media/base/videocommon.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/libjingle/source/talk/media/base/videocommon.h')
-rw-r--r--chromium/third_party/libjingle/source/talk/media/base/videocommon.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/chromium/third_party/libjingle/source/talk/media/base/videocommon.h b/chromium/third_party/libjingle/source/talk/media/base/videocommon.h
index cf24f6fbb39..c83a3d8d13a 100644
--- a/chromium/third_party/libjingle/source/talk/media/base/videocommon.h
+++ b/chromium/third_party/libjingle/source/talk/media/base/videocommon.h
@@ -212,11 +212,20 @@ struct VideoFormat : VideoFormatPod {
}
static int IntervalToFps(int64 interval) {
- // Normalize the interval first.
- interval = talk_base::_max(interval, kMinimumInterval);
+ if (!interval) {
+ return 0;
+ }
return static_cast<int>(talk_base::kNumNanosecsPerSec / interval);
}
+ static float IntervalToFpsFloat(int64 interval) {
+ if (!interval) {
+ return 0.f;
+ }
+ return static_cast<float>(talk_base::kNumNanosecsPerSec) /
+ static_cast<float>(interval);
+ }
+
bool operator==(const VideoFormat& format) const {
return width == format.width && height == format.height &&
interval == format.interval && fourcc == format.fourcc;