/* Set the XV_SWITCHCRT property to 1, so that Xv output goes to the second * head of a dual-head card. (In my case, an ATi Radeon 9200SE, where I'm using * the analogue output.) * Released into the public domain; by Adam Sampson */ #include #include #include #include #include void die(const char *s) { fprintf(stderr, "xvset: %s\n", s); exit(1); } int main(int argc, char **argv) { Display *display; Atom attribute; unsigned int nadaptors; XvAdaptorInfo *ainfo; display = XOpenDisplay(NULL); if (!display) die("can't open display"); XvQueryAdaptors(display, RootWindow(display, 0), &nadaptors, &ainfo); if (nadaptors != 1) die("not exactly 1 adaptor"); attribute = XInternAtom(display, "XV_SWITCHCRT", False); XvSetPortAttribute(display, ainfo[0].base_id, attribute, 1); XCloseDisplay(display); return 0; }