merge after backing out changeset e6566d187edd

This commit is contained in:
Daniel Holbert 2009-01-21 22:37:24 -08:00
commit 4645e0a141
3 changed files with 4 additions and 25 deletions

View File

@ -203,15 +203,10 @@ void nsMediaDecoder::SetRGBData(PRInt32 aWidth, PRInt32 aHeight, float aFramerat
}
mFramerate = aFramerate;
if (aRGBBuffer) {
if (!mRGB) {
mRGB = new unsigned char[aWidth * aHeight * 4];
}
if (mRGB) {
memcpy(mRGB.get(), aRGBBuffer, aWidth*aHeight*4);
}
} else {
mRGB = nsnull;
if (!mRGB)
mRGB = new unsigned char[aWidth * aHeight * 4];
if (mRGB && aRGBBuffer) {
memcpy(mRGB.get(), aRGBBuffer, aWidth*aHeight*4);
}
}

View File

@ -1094,20 +1094,11 @@ void nsOggDecodeStateMachine::LoadOggHeaders()
if (mVideoTrack == -1 && oggplay_get_track_type(mPlayer, i) == OGGZ_CONTENT_THEORA) {
oggplay_set_callback_num_frames(mPlayer, i, 1);
mVideoTrack = i;
int fpsd, fpsn;
oggplay_get_video_fps(mPlayer, i, &fpsd, &fpsn);
mFramerate = fpsd == 0 ? 0.0 : float(fpsn)/float(fpsd);
mCallbackPeriod = 1.0 / mFramerate;
LOG(PR_LOG_DEBUG, ("Frame rate: %f", mFramerate));
int y_width;
int y_height;
oggplay_get_video_y_size(mPlayer, i, &y_width, &y_height);
{
nsAutoLock lock(mDecoder->mVideoUpdateLock);
mDecoder->SetRGBData(y_width, y_height, mFramerate, nsnull);
}
}
else if (mAudioTrack == -1 && oggplay_get_track_type(mPlayer, i) == OGGZ_CONTENT_VORBIS) {
mAudioTrack = i;
@ -1456,11 +1447,6 @@ void nsOggDecoder::MetadataLoaded()
}
if (mElement && notifyElement) {
{
nsAutoLock lock(mVideoUpdateLock);
mElement->UpdateMediaSize(nsIntSize(mRGBWidth, mRGBHeight));
mSizeChanged = PR_FALSE;
}
mElement->MetadataLoaded();
}

View File

@ -53,8 +53,6 @@ function loadedData() {
function loadedMetaData() {
gLoadedMetaDataCount++;
ok(gLoadedMetaDataCount <= 1, "No more than 1 onloadedmetadata events");
is(video().videoWidth, 320, "width is available");
is(video().videoHeight, 240, "height is available");
video().play();
return false;
}