diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-11-13 14:08:40 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-11-13 14:14:37 -0800 |
commit | 6d9bdc10f349090e092887222e0e03202b1b0d55 (patch) | |
tree | 0a1a87ea5e07c10593704495237a90302a10262f /xvinfo.c | |
parent | d1022529af4baba0a123cafd97c83644c6067f53 (diff) |
Variable scope reduction
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xvinfo.c')
-rw-r--r-- | xvinfo.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -25,13 +25,7 @@ main(int argc, char *argv[]) { Display *dpy; unsigned int ver, rev, eventB, reqB, errorB; - unsigned int nencode, nadaptors; - int nscreens, nattr, numImages; - XvAdaptorInfo *ainfo; - XvAttribute *attributes; - XvEncodingInfo *encodings; - XvFormat *format; - XvImageFormatValues *formats; + int nscreens; char *disname = NULL; char shortmode = 0; @@ -82,6 +76,9 @@ main(int argc, char *argv[]) nscreens = ScreenCount(dpy); for (int i = 0; i < nscreens; i++) { + unsigned int nadaptors; + XvAdaptorInfo *ainfo; + fprintf(stdout, "screen #%i\n", i); if (Success != XvQueryAdaptors(dpy, RootWindow(dpy, i), &nadaptors, &ainfo)) { @@ -96,6 +93,12 @@ main(int argc, char *argv[]) } for (unsigned int j = 0; j < nadaptors; j++) { + XvFormat *format; + int nattr; + XvAttribute *attributes; + unsigned int nencode; + XvEncodingInfo *encodings; + fprintf(stdout, " Adaptor #%i: \"%s\"\n", j, ainfo[j].name); fprintf(stdout, " number of ports: %li\n", ainfo[j].num_ports); fprintf(stdout, " port base: %li\n", ainfo[j].base_id); @@ -218,6 +221,9 @@ main(int argc, char *argv[]) } if (ImageEncodings && (ainfo[j].type & XvImageMask)) { + int numImages; + XvImageFormatValues *formats; + for (unsigned int n = 0; n < nencode; n++) { if (!strcmp(encodings[n].name, "XV_IMAGE")) { fprintf(stdout, |