From eaa6e4a2d98b3f04b4e1d9cd7db6185015d370d7 Mon Sep 17 00:00:00 2001
Date: Mon, 18 Feb 2013 11:46:38 +0000
Subject: [PATCH] fixed-compile-with-VDPAU-header-versions-without-MPE

---
 configure          |    2 ++
 libavcodec/vdpau.c |    2 ++
 libavcodec/vdpau.h |    2 ++
 3 files changed, 6 insertions(+)

diff --git a/configure b/configure
index 0707a94..6b9e668 100755
--- a/configure
+++ b/configure
@@ -3748,6 +3748,8 @@ check_header termios.h
 check_header unistd.h
 check_header vdpau/vdpau.h
 check_header vdpau/vdpau_x11.h
+check_cpp_condition vdpau/vdpau.h "defined(VDP_DECODER_PROFILE_MPEG4_PART2_SP)" && enable vdpau_mpeg4_support
+
 check_header VideoDecodeAcceleration/VDADecoder.h
 check_header windows.h
 check_header X11/extensions/XvMClib.h
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 6ac195e..09dcb3e 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -316,6 +316,7 @@ void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf,
     render->bitstream_buffers_used        = 0;
 }
 
+#ifdef VDP_DECODER_PROFILE_MPEG4_PART2_SP
 void ff_vdpau_mpeg4_decode_picture(MpegEncContext *s, const uint8_t *buf,
                                    int buf_size)
 {
@@ -369,6 +370,7 @@ void ff_vdpau_mpeg4_decode_picture(MpegEncContext *s, const uint8_t *buf,
     ff_draw_horiz_band(s, 0, s->avctx->height);
     render->bitstream_buffers_used = 0;
 }
+#endif
 
 // Only dummy functions for now
 static int vdpau_mpeg2_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
diff --git a/libavcodec/vdpau.h b/libavcodec/vdpau.h
index 23394b5..67fadb6 100644
--- a/libavcodec/vdpau.h
+++ b/libavcodec/vdpau.h
@@ -56,7 +56,9 @@ union FFVdpPictureInfo {
     VdpPictureInfoH264        h264;
     VdpPictureInfoMPEG1Or2    mpeg;
     VdpPictureInfoVC1          vc1;
-    VdpPictureInfoMPEG4Part2 mpeg4;
+#ifdef VDP_DECODER_PROFILE_MPEG4_PART2_SP
+        VdpPictureInfoMPEG4Part2 mpeg4;
+#endif
 };

 /**
 
-- 
1.7.10.4



