Backout due to Windows build failure

This commit is contained in:
Chris Double 2009-02-20 16:02:32 +13:00
Родитель a6c2a0a171 a4e6f4dbf4
Коммит 7ad218cfe8
4 изменённых файлов: 4 добавлений и 34 удалений

Просмотреть файл

@ -73,11 +73,6 @@ public:
// Resume any downloads that have been suspended. // Resume any downloads that have been suspended.
void Resume(); 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(); nsIPrincipal* GetCurrentPrincipal();
// Implementation of OggPlay Reader API. // Implementation of OggPlay Reader API.
@ -86,13 +81,9 @@ public:
size_t io_read(char* aBuffer, size_t aCount); size_t io_read(char* aBuffer, size_t aCount);
int io_seek(long aOffset, int aWhence); int io_seek(long aOffset, int aWhence);
long io_tell(); long io_tell();
ogg_int64_t duration();
public: public:
nsMediaStream mStream; nsMediaStream mStream;
// Duration of the media resource. -1 if not known.
PRInt64 mDuration;
}; };
#endif #endif

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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