From c74d6ef0103ddbd61b4633dab80e8952b2fb71f6 Mon Sep 17 00:00:00 2001
From: johns <>
Date: Sun, 21 Jul 2002 19:46:45 +0000
Subject: [PATCH] Play sound only if compiled with OGG support.

---
 src/video/movie.cpp | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/video/movie.cpp b/src/video/movie.cpp
index cf4354135..723c9ec22 100644
--- a/src/video/movie.cpp
+++ b/src/video/movie.cpp
@@ -134,13 +134,15 @@ global int MovieDisplayFrame(AviFile* avi, PB_INSTANCE* pbi,
 		pbi->LastFrameRecon + pbi->ReconYDataOffset + (height - i -
 		    1) * pbi->Configuration.YStride, width);
 	}
-	for (i = 0; i < height / 2; ++i) {	// copy UV
+	height >>= 1;
+	width >>= 1;
+	for (i = 0; i < height; ++i) {	// copy UV
 	    memcpy(overlay->pixels[1] + i * overlay->pitches[1],
-		pbi->LastFrameRecon + pbi->ReconVDataOffset + (height / 2 - i -
-		    1) * pbi->Configuration.UVStride, width / 2);
+		pbi->LastFrameRecon + pbi->ReconVDataOffset + (height - i -
+		    1) * pbi->Configuration.UVStride, width);
 	    memcpy(overlay->pixels[2] + i * overlay->pitches[2],
-		pbi->LastFrameRecon + pbi->ReconUDataOffset + (height / 2 - i -
-		    1) * pbi->Configuration.UVStride, width / 2);
+		pbi->LastFrameRecon + pbi->ReconUDataOffset + (height - i -
+		    1) * pbi->Configuration.UVStride, width);
 	}
 	SDL_UnlockYUVOverlay(overlay);
     }
@@ -236,7 +238,9 @@ global int PlayMovie(const char *name, int flags)
 
     StartDecoder(&pbi, avi->Width, avi->Height);
 
+#ifdef USE_OGG
     PlayAviOgg(avi);
+#endif
 
     callbacks.ButtonPressed=MovieCallbackKey;
     callbacks.ButtonReleased=MovieCallbackKey;