Index: webkit/glue/webmediaplayer_impl.cc |
diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc |
index f5b87cf8da1c0302e9c3f1933948acda4b8aa936..4de52a34c45c797a1f6a1e17c8d4335903202969 100644 |
--- a/webkit/glue/webmediaplayer_impl.cc |
+++ b/webkit/glue/webmediaplayer_impl.cc |
@@ -4,6 +4,8 @@ |
#include "webkit/glue/webmediaplayer_impl.h" |
+#include <limits> |
+ |
#include "base/callback.h" |
#include "base/command_line.h" |
#include "media/base/limits.h" |
@@ -417,7 +419,10 @@ bool WebMediaPlayerImpl::seeking() const { |
float WebMediaPlayerImpl::duration() const { |
DCHECK(MessageLoop::current() == main_loop_); |
- return static_cast<float>(pipeline_->GetMediaDuration().InSecondsF()); |
+ base::TimeDelta duration = pipeline_->GetMediaDuration(); |
+ if (duration.InMicroseconds() == media::Limits::kMaxTimeInMicroseconds) |
+ return std::numeric_limits<float>::infinity(); |
+ return static_cast<float>(duration.InSecondsF()); |
} |
float WebMediaPlayerImpl::currentTime() const { |