Index: media/filters/ffmpeg_demuxer.cc |
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc |
index 9a088ac3b2a03f3b97d26540fafa7d8af0c3909a..d0cbda3dc567bdf9106cfff4e3697e4a965bbd0d 100644 |
--- a/media/filters/ffmpeg_demuxer.cc |
+++ b/media/filters/ffmpeg_demuxer.cc |
@@ -9,6 +9,7 @@ |
#include "base/string_util.h" |
#include "base/time.h" |
#include "media/base/filter_host.h" |
+#include "media/base/limits.h" |
#include "media/base/media_switches.h" |
#include "media/ffmpeg/ffmpeg_common.h" |
#include "media/ffmpeg/ffmpeg_util.h" |
@@ -469,7 +470,13 @@ void FFmpegDemuxer::InitializeTask(DataSource* data_source, |
max_duration = |
std::max(max_duration, |
ConvertTimestamp(av_time_base, format_context_->duration)); |
+ } else { |
+ // If the duration is not a valid value. Assume that this is a live stream |
+ // and we set duration to the maximum int64 number to represent infinity. |
+ max_duration = base::TimeDelta::FromMicroseconds( |
+ Limits::kMaxTimeInMicroseconds); |
} |
+ |
fgalligan1
2010/08/03 14:17:38
Would it be better to check if max_duration == AV_
|
// Good to go: set the duration and notify we're done initializing. |
host()->SetDuration(max_duration); |
callback->Run(); |