1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-21 04:39:45 +00:00

Patches contributed by Adam to resolve movie playback:

- vcxproj file issues (local paths, Debug configurations)
- defer movie playback until mouse plate properly sized
- correct conditional and type for plMoviePlayer::Start() reference fVideoTrack
- fix typing to call plPlanarImage::Yuv420ToRgba() causing color artifacting
This commit is contained in:
2020-08-11 10:17:46 -06:00
committed by rarified
parent 33a1e301f7
commit b233409580
5 changed files with 17 additions and 18 deletions

View File

@ -347,7 +347,7 @@ bool plMoviePlayer::Start()
#ifdef PLASMA_USE_WEBM
if (!IOpenMovie())
return false;
hsAssert(fVideoTrack, "nil video track -- expect bad things to happen!");
hsAssert(fVideoTrack.get(), "nil video track -- expect bad things to happen!");
hsStatusMessageF("Opened movie %s\n", fMoviePath);
// Initialize VPX
@ -415,7 +415,7 @@ bool plMoviePlayer::NextFrame()
fMovieTime += frameTimeDelta;
std::vector<blkbuf_t> video;
if (fVideoTrack.get() != nullptr || !fVideoTrack->GetFrames(fReader, fMovieTime * 1000000, video)) {
if (fVideoTrack.get() == nullptr || !fVideoTrack->GetFrames(fReader, fMovieTime * 1000000, video)) {
Stop();
return false;
}

View File

@ -44,7 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
///////////////////////////////////////////////////////////////////////////////
static UInt8 Clip(UInt32 val) {
static UInt8 Clip(Int32 val) {
if (val < 0) {
return 0;
} else if (val > 255) {
@ -83,10 +83,10 @@ void plPlanarImage::Yuv420ToRgba(UInt32 w, UInt32 h, const Int32* stride, UInt8*
size_t v_idx = stride[2] * (i/2) + (j/2);
size_t dest_idx = w * i + j;
UInt32 y = static_cast<UInt32>(y_src[y_idx]);
UInt32 u = static_cast<UInt32>(u_src[u_idx]);
UInt32 v = static_cast<UInt32>(v_src[v_idx]);
UInt32 y1 = (y - 16) * YG;
Int32 y = static_cast<Int32>(y_src[y_idx]);
Int32 u = static_cast<Int32>(u_src[u_idx]);
Int32 v = static_cast<Int32>(v_src[v_idx]);
Int32 y1 = (y - 16) * YG;
dest[dest_idx*4+0] = Clip(((u * UB + v * VB) - (BB) + y1) >> 6);
dest[dest_idx*4+1] = Clip(((u * UG + v * VG) - (BG) + y1) >> 6);