summaryrefslogtreecommitdiff
path: root/src/sna/sna_video.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-19 10:08:29 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-19 10:08:29 +0000
commit9df5e48c582e5c4edffdece75b5395c230a50b09 (patch)
tree5c7eafe93373646dcf5064977f44898ee20945a2 /src/sna/sna_video.c
parentb6588c48077600a3e015b6d37b101393a806ae1a (diff)
sna/video: Only setup XvMC if we first setup Xv
Under certain circumstances, XvScreenInit can indeed fail, so do not bother with creatin XvMC (as it triggers internal assertions if it cannot find our adaptor amongst Xv's). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_video.c')
-rw-r--r--src/sna/sna_video.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index 07fa829f..ecf52d21 100644
--- a/src/sna/sna_video.c
+++ b/src/sna/sna_video.c
@@ -569,13 +569,13 @@ void sna_video_init(struct sna *sna, ScreenPtr screen)
if (overlay && !prefer_overlay)
adaptors[num_adaptors++] = overlay;
- if (num_adaptors)
- xf86XVScreenInit(screen, adaptors, num_adaptors);
- else
+ if (num_adaptors) {
+ Bool ok = xf86XVScreenInit(screen, adaptors, num_adaptors);
+ if (ok && textured)
+ sna_video_xvmc_setup(sna, screen, textured);
+ } else
xf86DrvMsg(sna->scrn->scrnIndex, X_WARNING,
"Disabling Xv because no adaptors could be initialized.\n");
- if (textured)
- sna_video_xvmc_setup(sna, screen, textured);
free(adaptors);
}