Bug 1093020 - Don't use a buffering wait for MSE. r=cpearce

This commit is contained in:
Bobby Holley 2014-11-11 20:50:22 -08:00
parent 21c29c6312
commit 356c46f407
3 changed files with 12 additions and 6 deletions

View File

@ -153,6 +153,11 @@ public:
virtual int64_t ComputeStartTime(const VideoData* aVideo, const AudioData* aAudio);
// Wait this number of seconds when buffering, then leave and play
// as best as we can if the required amount of data hasn't been
// retrieved.
virtual uint32_t GetBufferingWait() { return 30; }
// Returns the number of bytes of memory allocated by structures/frames in
// the video queue.
size_t SizeOfVideoQueueInBytes() const;

View File

@ -84,11 +84,6 @@ extern PRLogModuleInfo* gMediaDecoderLog;
#undef GetCurrentTime
#endif
// Wait this number of seconds when buffering, then leave and play
// as best as we can if the required amount of data hasn't been
// retrieved.
static const uint32_t BUFFERING_WAIT_S = 30;
// If audio queue has less than this many usecs of decoded audio, we won't risk
// trying to decode the video, we'll skip decoding video up to the next
// keyframe. We may increase this value for an individual decoder if we
@ -224,7 +219,7 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
mAmpleVideoFrames =
std::max<uint32_t>(Preferences::GetUint("media.video-queue.default-size", 10), 3);
mBufferingWait = mScheduler->IsRealTime() ? 0 : BUFFERING_WAIT_S;
mBufferingWait = mScheduler->IsRealTime() ? 0 : mReader->GetBufferingWait();
mLowDataThresholdUsecs = mScheduler->IsRealTime() ? 0 : LOW_DATA_THRESHOLD_USECS;
mVideoPrerollFrames = mScheduler->IsRealTime() ? 0 : mAmpleVideoFrames / 2;

View File

@ -75,6 +75,12 @@ public:
// as chrome/blink and assumes that we always start at t=0.
virtual int64_t ComputeStartTime(const VideoData* aVideo, const AudioData* aAudio) MOZ_OVERRIDE { return 0; }
// Buffering waits (in which we decline to present decoded frames because we
// "don't have enough") don't really make sense for MSE. The delay is
// essentially a streaming heuristic, but JS is supposed to take care of that
// in the MSE world. Avoid injecting inexplicable delays.
virtual uint32_t GetBufferingWait() { return 0; }
bool IsMediaSeekable() { return true; }
nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) MOZ_OVERRIDE;