[vlc-commits] vdpau: add some sanity checking assertion

Rémi Denis-Courmont git at videolan.org
Tue Jul 9 18:04:45 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul  8 22:40:27 2013 +0300| [aba52bc121ea9c969eb05f771403ef75e23f5265] | committer: Rémi Denis-Courmont

vdpau: add some sanity checking assertion

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aba52bc121ea9c969eb05f771403ef75e23f5265
---

 modules/hw/vdpau/picture.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/hw/vdpau/picture.c b/modules/hw/vdpau/picture.c
index 9a549b8..38281f2 100644
--- a/modules/hw/vdpau/picture.c
+++ b/modules/hw/vdpau/picture.c
@@ -76,6 +76,9 @@ VdpStatus vlc_vdp_video_attach(vdp_t *vdp, VdpVideoSurface surface,
         return VDP_STATUS_RESOURCES;
     }
 
+    assert(pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_420
+        || pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_422);
+    assert(!picture_IsReferenced(pic));
     assert(pic->context == NULL);
     pic->context = field;
 
@@ -99,6 +102,11 @@ VdpStatus vlc_vdp_video_copy(picture_t *restrict dst, picture_t *restrict src)
     if (unlikely(fnew == NULL))
         return VDP_STATUS_RESOURCES;
 
+    assert(src->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_420
+        || src->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_422);
+    assert(dst->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_420
+        || dst->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_422);
+    assert(!picture_IsReferenced(dst));
     assert(dst->context == NULL);
     dst->context = fnew;
 



More information about the vlc-commits mailing list