st/vdpau: don't try to create video buffer when the format is FORMAT_NONE
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 16 Aug 2013 22:10:20 +0000 (23:10 +0100)
committerChristian König <christian.koenig@amd.com>
Mon, 19 Aug 2013 16:32:03 +0000 (18:32 +0200)
Not seen in the wild yet, but seems like a reasonable thing to do.
[suggested by Christian]

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/state_trackers/vdpau/surface.c

index ab4d725cb362fe149b1966ee33467535daead19c..8e39d68a70642b7d01216eee765d4be0657841a2 100644 (file)
@@ -88,7 +88,10 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type,
       PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
       PIPE_VIDEO_CAP_PREFERS_INTERLACED
    );
-   p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat);
+   if (p_surf->templat.buffer_format != PIPE_FORMAT_NONE)
+      p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat);
+
+   /* do not mandate early allocation of a video buffer */
    vlVdpVideoSurfaceClear(p_surf);
    pipe_mutex_unlock(dev->mutex);