summaryrefslogtreecommitdiff
path: root/src/libXvMC
diff options
context:
space:
mode:
Diffstat (limited to 'src/libXvMC')
-rw-r--r--src/libXvMC/Makefile2
-rw-r--r--src/libXvMC/block.c10
-rw-r--r--src/libXvMC/context.c6
-rw-r--r--src/libXvMC/surface.c10
4 files changed, 20 insertions, 8 deletions
diff --git a/src/libXvMC/Makefile b/src/libXvMC/Makefile
index 4de26e9620..7badcfd264 100644
--- a/src/libXvMC/Makefile
+++ b/src/libXvMC/Makefile
@@ -8,7 +8,7 @@ ifeq (${DRIVER}, softpipe)
OBJECTS += ${GALLIUMDIR}/winsys/g3dvl/xsp_winsys.o
endif
-CFLAGS += -g -fPIC -Wall \
+CFLAGS += -g -fPIC -Wall -Werror=implicit-function-declaration \
-I${GALLIUMDIR}/state_trackers/g3dvl \
-I${GALLIUMDIR}/winsys/g3dvl \
-I${GALLIUMDIR}/include \
diff --git a/src/libXvMC/block.c b/src/libXvMC/block.c
index 328b035576..b38a89be09 100644
--- a/src/libXvMC/block.c
+++ b/src/libXvMC/block.c
@@ -1,7 +1,7 @@
#include <assert.h>
-#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/extensions/XvMC.h>
+#include <util/u_memory.h>
#include <vl_display.h>
#include <vl_screen.h>
#include <vl_context.h>
@@ -26,7 +26,7 @@ Status XvMCCreateBlocks(Display *display, XvMCContext *context, unsigned int num
blocks->context_id = context->context_id;
blocks->num_blocks = num_blocks;
- blocks->blocks = malloc(BLOCK_SIZE * num_blocks);
+ blocks->blocks = MALLOC(BLOCK_SIZE * num_blocks);
/* Since we don't have a VL type for blocks, set privData to the display so we can catch mismatches */
blocks->privData = display;
@@ -38,7 +38,7 @@ Status XvMCDestroyBlocks(Display *display, XvMCBlockArray *blocks)
assert(display);
assert(blocks);
assert(display == blocks->privData);
- free(blocks->blocks);
+ FREE(blocks->blocks);
return Success;
}
@@ -61,7 +61,7 @@ Status XvMCCreateMacroBlocks(Display *display, XvMCContext *context, unsigned in
blocks->context_id = context->context_id;
blocks->num_blocks = num_blocks;
- blocks->macro_blocks = malloc(sizeof(XvMCMacroBlock) * num_blocks);
+ blocks->macro_blocks = MALLOC(sizeof(XvMCMacroBlock) * num_blocks);
/* Since we don't have a VL type for blocks, set privData to the display so we can catch mismatches */
blocks->privData = display;
@@ -73,7 +73,7 @@ Status XvMCDestroyMacroBlocks(Display *display, XvMCMacroBlockArray *blocks)
assert(display);
assert(blocks);
assert(display == blocks->privData);
- free(blocks->macro_blocks);
+ FREE(blocks->macro_blocks);
return Success;
}
diff --git a/src/libXvMC/context.c b/src/libXvMC/context.c
index 698410d4c2..273f658029 100644
--- a/src/libXvMC/context.c
+++ b/src/libXvMC/context.c
@@ -182,6 +182,8 @@ Status XvMCCreateContext(Display *display, XvPortID port, int surface_type_id, i
Status XvMCDestroyContext(Display *display, XvMCContext *context)
{
struct vlContext *vl_ctx;
+ struct vlScreen *vl_screen;
+ struct vlDisplay *vl_dpy;
struct pipe_context *pipe;
assert(display);
@@ -194,7 +196,11 @@ Status XvMCDestroyContext(Display *display, XvMCContext *context)
assert(display == vlGetNativeDisplay(vlGetDisplay(vlContextGetScreen(vl_ctx))));
pipe = vlGetPipeContext(vl_ctx);
+ vl_screen = vlContextGetScreen(vl_ctx);
+ vl_dpy = vlGetDisplay(vl_screen);
vlDestroyContext(vl_ctx);
+ vlDestroyScreen(vl_screen);
+ vlDestroyDisplay(vl_dpy);
destroy_pipe_context(pipe);
return Success;
diff --git a/src/libXvMC/surface.c b/src/libXvMC/surface.c
index 6031b39d10..67c179e66d 100644
--- a/src/libXvMC/surface.c
+++ b/src/libXvMC/surface.c
@@ -261,8 +261,14 @@ Status XvMCPutSurface
assert(srcx + srcw - 1 < surface->width);
assert(srcy + srch - 1 < surface->height);
- assert(destx + destw - 1 < width);
- assert(desty + desth - 1 < height);
+ /* XXX: Some apps (mplayer) hit these asserts because they call
+ * this function after the window has been resized by the WM
+ * but before they've handled the corresponding XEvent and
+ * know about the new dimensions. The output will be clipped
+ * for a few frames until the app updates destw and desth.
+ */
+ /*assert(destx + destw - 1 < width);
+ assert(desty + desth - 1 < height);*/
vl_sfc = surface->privData;