Backed out changeset 2b7e176d9e73

This commit is contained in:
Chris Double 2009-02-20 16:01:58 +13:00
parent f95ec3e145
commit 66f2bcbbca
4 changed files with 4 additions and 34 deletions

View File

@ -73,11 +73,6 @@ public:
// Resume any downloads that have been suspended.
void Resume();
// Set the duration of the media resource. Call with decoder lock
// obtained so that the decoder thread does not request the duration
// while it is changing.
void SetDuration(PRInt64 aDuration);
nsIPrincipal* GetCurrentPrincipal();
// Implementation of OggPlay Reader API.
@ -86,13 +81,9 @@ public:
size_t io_read(char* aBuffer, size_t aCount);
int io_seek(long aOffset, int aWhence);
long io_tell();
ogg_int64_t duration();
public:
nsMediaStream mStream;
// Duration of the media resource. -1 if not known.
PRInt64 mDuration;
};
#endif

View File

@ -69,11 +69,6 @@ void nsChannelReader::Resume()
mStream.Resume();
}
void nsChannelReader::SetDuration(PRInt64 aDuration)
{
mDuration = aDuration;
}
size_t nsChannelReader::io_read(char* aBuffer, size_t aCount)
{
PRUint32 bytes = 0;
@ -98,11 +93,6 @@ long nsChannelReader::io_tell()
return mStream.Tell();
}
ogg_int64_t nsChannelReader::duration()
{
return mDuration;
}
static OggPlayErrorCode oggplay_channel_reader_initialise(OggPlayReader* aReader, int aBlock)
{
nsChannelReader * me = static_cast<nsChannelReader*>(aReader);
@ -137,12 +127,6 @@ static long oggplay_channel_reader_io_tell(void* aReader)
return me->io_tell();
}
static ogg_int64_t oggplay_channel_reader_duration(struct _OggPlayReader *aReader)
{
nsChannelReader* me = static_cast<nsChannelReader*>(aReader);
return me->duration();
}
nsresult nsChannelReader::Init(nsMediaDecoder* aDecoder, nsIURI* aURI,
nsIChannel* aChannel,
nsIStreamListener** aStreamListener)
@ -155,8 +139,7 @@ nsChannelReader::~nsChannelReader()
MOZ_COUNT_DTOR(nsChannelReader);
}
nsChannelReader::nsChannelReader() :
mDuration(-1)
nsChannelReader::nsChannelReader()
{
MOZ_COUNT_CTOR(nsChannelReader);
OggPlayReader* reader = this;
@ -166,7 +149,7 @@ nsChannelReader::nsChannelReader() :
reader->io_read = &oggplay_channel_reader_io_read;
reader->io_seek = &oggplay_channel_reader_io_seek;
reader->io_tell = &oggplay_channel_reader_io_tell;
reader->duration = &oggplay_channel_reader_duration;
reader->duration = nsnull;
}
nsIPrincipal*

View File

@ -653,6 +653,7 @@ private:
nsresult nsHttpStreamStrategy::Seek(PRInt32 aWhence, PRInt64 aOffset)
{
PRInt64 totalBytes = mDecoder->GetStatistics().mTotalBytes;
{
nsAutoLock lock(mLock);
if (!mChannel || !mPipeInput)
@ -718,6 +719,7 @@ nsresult nsHttpStreamStrategy::Seek(PRInt32 aWhence, PRInt64 aOffset)
nsAutoArrayPtr<char> data(new char[bytesAhead]);
if (!data)
return NS_ERROR_OUT_OF_MEMORY;
// Read until the read cursor reaches new seek point. If Cancel() is
// called then the read will fail with an error so we can bail out of
// the blocking call.

View File

@ -675,7 +675,6 @@ void nsOggDecodeStateMachine::PlayFrame() {
// Reset the play start time.
mPlayStartTime = PR_IntervalNow();
mPauseDuration = 0;
frame->mState = OGGPLAY_STREAM_INITIALISED;
}
double time = (PR_IntervalToMilliseconds(PR_IntervalNow()-mPlayStartTime-mPauseDuration)/1000.0);
@ -1236,7 +1235,6 @@ void nsOggDecodeStateMachine::LoadOggHeaders()
// and blocks until these are completed.
mon.Exit();
PRInt64 d = oggplay_get_duration(mPlayer);
oggplay_seek(mPlayer, 0);
mon.Enter();
mDuration = d;
mDecoder->StartProgressUpdates();
@ -1960,10 +1958,6 @@ void nsOggDecoder::SetDuration(PRInt64 aDuration)
if (mDecodeStateMachine) {
nsAutoMonitor mon(mMonitor);
mDecodeStateMachine->SetDuration(mDuration);
if (mReader) {
mReader->SetDuration(mDuration);
}
}
}