mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
Bug 566501 - Remove unnecessary seek from the video decoder base class. r=cpearce
This commit is contained in:
parent
5b7c6059a4
commit
264f50b5de
@ -266,9 +266,6 @@ VideoData* nsBuiltinDecoderReader::FindStartTime(PRInt64 aOffset,
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnStateMachineThread(), "Should be on state machine thread.");
|
||||
|
||||
nsMediaStream* stream = mDecoder->GetCurrentStream();
|
||||
|
||||
stream->Seek(nsISeekableStream::NS_SEEK_SET, aOffset);
|
||||
if (NS_FAILED(ResetDecode())) {
|
||||
return nsnull;
|
||||
}
|
||||
|
@ -429,8 +429,8 @@ public:
|
||||
|
||||
// Stores the presentation time of the first sample in the stream in
|
||||
// aOutStartTime, and returns the first video sample, if we have video.
|
||||
VideoData* FindStartTime(PRInt64 aOffset,
|
||||
PRInt64& aOutStartTime);
|
||||
virtual VideoData* FindStartTime(PRInt64 aOffset,
|
||||
PRInt64& aOutStartTime);
|
||||
|
||||
// Returns the end time of the last page which occurs before aEndOffset.
|
||||
// This will not read past aEndOffset. Returns -1 on failure.
|
||||
|
@ -1213,12 +1213,6 @@ void nsBuiltinDecoderStateMachine::FindEndTime()
|
||||
mEndTime = endTime;
|
||||
}
|
||||
|
||||
NS_ASSERTION(mReader->GetInfo().mDataOffset > 0,
|
||||
"Should have offset of first non-header page");
|
||||
{
|
||||
MonitorAutoExit exitMon(mDecoder->GetMonitor());
|
||||
stream->Seek(nsISeekableStream::NS_SEEK_SET, mReader->GetInfo().mDataOffset);
|
||||
}
|
||||
LOG(PR_LOG_DEBUG, ("%p Media end time is %lldms", mDecoder, mEndTime));
|
||||
}
|
||||
|
||||
|
@ -800,6 +800,16 @@ GetChecksum(ogg_page* page)
|
||||
return c;
|
||||
}
|
||||
|
||||
VideoData* nsOggReader::FindStartTime(PRInt64 aOffset,
|
||||
PRInt64& aOutStartTime)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnStateMachineThread(), "Should be on state machine thread.");
|
||||
|
||||
nsMediaStream* stream = mDecoder->GetCurrentStream();
|
||||
stream->Seek(nsISeekableStream::NS_SEEK_SET, aOffset);
|
||||
return nsBuiltinDecoderReader::FindStartTime(aOffset, aOutStartTime);
|
||||
}
|
||||
|
||||
PRInt64 nsOggReader::FindEndTime(PRInt64 aEndOffset)
|
||||
{
|
||||
MonitorAutoEnter mon(mMonitor);
|
||||
@ -914,6 +924,10 @@ PRInt64 nsOggReader::FindEndTime(PRInt64 aEndOffset)
|
||||
|
||||
ogg_sync_reset(&mOggState);
|
||||
|
||||
NS_ASSERTION(mDataOffset > 0,
|
||||
"Should have offset of first non-header page");
|
||||
stream->Seek(nsISeekableStream::NS_SEEK_SET, mDataOffset);
|
||||
|
||||
return endTime;
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,8 @@ public:
|
||||
// read have valid time info.
|
||||
virtual PRBool DecodeVideoFrame(PRBool &aKeyframeSkip,
|
||||
PRInt64 aTimeThreshold);
|
||||
virtual VideoData* FindStartTime(PRInt64 aOffset,
|
||||
PRInt64& aOutStartTime);
|
||||
virtual PRInt64 FindEndTime(PRInt64 aEndOffset);
|
||||
|
||||
virtual PRBool HasAudio()
|
||||
|
Loading…
Reference in New Issue
Block a user