Backed out changeset ac5e69c40ff1 (bug 1089480) for m-2 bustage on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2014-10-28 08:21:10 +01:00
parent 7c0f94eb40
commit b11b77b493
4 changed files with 20 additions and 27 deletions

View File

@ -20,10 +20,15 @@ namespace mozilla {
#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaDecoderLog;
#define DECODER_LOG(x, ...) \
PR_LOG(gMediaDecoderLog, PR_LOG_DEBUG, ("Decoder=%p " x, mDecoder, ##__VA_ARGS__))
#define DECODER_LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
#ifdef SEEK_LOGGING
#define SEEK_LOG(type, msg) PR_LOG(gMediaDecoderLog, type, msg)
#else
#define DECODER_LOG(x, ...)
#define SEEK_LOG(type, msg)
#endif
#else
#define DECODER_LOG(type, msg)
#define SEEK_LOG(type, msg)
#endif
class VideoQueueMemoryFunctor : public nsDequeFunctor {
@ -134,22 +139,6 @@ MediaDecoderReader::GetBuffered(mozilla::dom::TimeRanges* aBuffered,
return NS_OK;
}
int64_t
MediaDecoderReader::ComputeStartTime()
{
const VideoData* v = VideoQueue().PeekFront();
const AudioData* a = AudioQueue().PeekFront();
int64_t startTime = std::min<int64_t>(a ? a->mTime : INT64_MAX,
v ? v->mTime : INT64_MAX);
if (startTime == INT64_MAX) {
startTime = 0;
}
DECODER_LOG("ComputeStartTime first video frame start %lld", v ? v->mTime : -1);
DECODER_LOG("ComputeStartTime first audio frame start %lld", a ? a->mTime : -1);
return startTime;
}
class RequestVideoWithSkipTask : public nsRunnable {
public:
RequestVideoWithSkipTask(MediaDecoderReader* aReader,

View File

@ -148,8 +148,6 @@ public:
virtual nsresult GetBuffered(dom::TimeRanges* aBuffered,
int64_t aStartTime);
virtual int64_t ComputeStartTime();
// Returns the number of bytes of memory allocated by structures/frames in
// the video queue.
size_t SizeOfVideoQueueInBytes() const;

View File

@ -2016,7 +2016,18 @@ MediaDecoderStateMachine::FinishDecodeMetadata()
}
if (!mScheduler->IsRealTime() && !mDecodingFrozenAtStateMetadata) {
SetStartTime(mReader->ComputeStartTime());
const VideoData* v = VideoQueue().PeekFront();
const AudioData* a = AudioQueue().PeekFront();
int64_t startTime = std::min<int64_t>(a ? a->mTime : INT64_MAX,
v ? v->mTime : INT64_MAX);
if (startTime == INT64_MAX) {
startTime = 0;
}
DECODER_LOG("DecodeMetadata first video frame start %lld", v ? v->mTime : -1);
DECODER_LOG("DecodeMetadata first audio frame start %lld", a ? a->mTime : -1);
SetStartTime(startTime);
if (VideoQueue().GetSize()) {
ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
RenderVideoFrame(VideoQueue().PeekFront(), TimeStamp::Now());

View File

@ -70,11 +70,6 @@ public:
return mInfo.HasAudio();
}
// We can't compute a proper start time since we won't necessarily
// have the first frame of the resource available. This does the same
// as chrome/blink and assumes that we always start at t=0.
virtual int64_t ComputeStartTime() MOZ_OVERRIDE { return 0; }
bool IsMediaSeekable() { return true; }
nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) MOZ_OVERRIDE;