annotate TOOLS/vfw2menc.c @ 22258:9c1160622400

Reallocate event_images_t, removing limit on simultanious events count.
author eugeni
date Mon, 19 Feb 2007 17:44:29 +0000
parents c9aaf1f83588
children e980b665f469
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22252
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
1 /*
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
2 * VFW Compressor Settings Tool
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
3 *
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
4 * Copyright (c) 2006 Gianluigi Tiesi <sherpya@netfarm.it>
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
5 *
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or
22253
389c91ead5b6 Fix license header.
diego
parents: 22252
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
22252
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
22253
389c91ead5b6 Fix license header.
diego
parents: 22252
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
22252
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
10 *
22253
389c91ead5b6 Fix license header.
diego
parents: 22252
diff changeset
11 * This program is distributed in the hope that it will be useful,
22252
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22253
389c91ead5b6 Fix license header.
diego
parents: 22252
diff changeset
14 * Lesser General Public License for more details.
22252
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
15 *
22253
389c91ead5b6 Fix license header.
diego
parents: 22252
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
22254
c9aaf1f83588 10l copy and paste bug in the license header
diego
parents: 22253
diff changeset
17 * License along with this program; if not, write to the the Free Software
22252
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
19 */
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
20
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
21 /* On mingw compile with: gcc getopt.c vfw2menc.c -o vfw2menc.exe -lwinmm */
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
22 /* Using wine: winegcc getopt.c vfw2menc.c -o vfw2menc -lwinmm */
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
23
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
24 #ifdef _MSC_VER
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
25 #define _CRT_SECURE_NO_DEPRECATE
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
26 #pragma warning(disable: 4996)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
27 #endif
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
28
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
29 #include <stdio.h>
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
30 #include <stdlib.h>
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
31 #include <sys/stat.h>
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
32 #include <getopt.h>
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
33 #include <windows.h>
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
34 #include <vfw.h>
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
35
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
36 #define BAIL(msg) { printf("%s: %s\n", argv[0], msg); ret = -1; goto cleanup; }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
37
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
38 enum
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
39 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
40 MODE_NONE = 0,
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
41 MODE_CHECK,
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
42 MODE_SAVE,
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
43 MODE_VIEW
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
44 };
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
45
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
46 int save_settings(HDRVR hDriver, const char *filename)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
47 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
48 FILE *fd = NULL;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
49 DWORD cb = (DWORD) SendDriverMessage(hDriver, ICM_GETSTATE, 0, 0);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
50 char *pv = NULL;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
51
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
52 if (!cb)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
53 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
54 printf("ICM_GETSTATE returned 0 size\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
55 return -1;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
56 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
57
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
58 pv = (char *) malloc(cb);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
59 if (SendDriverMessage(hDriver, ICM_GETSTATE, (LPARAM) pv, (LPARAM) &cb) != ICERR_OK)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
60 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
61 printf("ICM_GETSTATE failed\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
62 free(pv);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
63 return -1;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
64 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
65
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
66 fd = fopen(filename, "wb");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
67 if (!fd)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
68 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
69 printf("Cannot open file %s for writing\n", filename);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
70 free(pv);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
71 return -1;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
72 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
73
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
74 if (fwrite(pv, cb, 1, fd) != 1)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
75 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
76 printf("fwrite() failed on %s\n", filename);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
77 free(pv);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
78 fclose(fd);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
79 return -1;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
80 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
81 fclose(fd);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
82 free(pv);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
83 return 0;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
84 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
85
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
86 int load_settings(HDRVR hDriver, const char *filename)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
87 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
88 struct stat info;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
89 FILE *fd = NULL;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
90 char *pv;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
91
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
92 if (stat(filename, &info) < 0)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
93 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
94 printf("stat() on %s failed\n", filename);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
95 return -1;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
96 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
97
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
98 pv = (char *) malloc(info.st_size);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
99 fd = fopen(filename, "rb");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
100
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
101 if (!fd)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
102 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
103 printf("Cannot open file %s for reading\n", filename);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
104 free(pv);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
105 return -1;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
106 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
107
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
108 if (fread(pv, info.st_size, 1, fd) != 1)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
109 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
110 printf("fread() failed on %s\n", filename);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
111 free(pv);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
112 fclose(fd);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
113 return -1;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
114 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
115 fclose(fd);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
116 if (!SendDriverMessage(hDriver, ICM_SETSTATE, (LPARAM) pv, (LPARAM) info.st_size))
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
117 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
118 printf("ICM_SETSTATE failed\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
119 free(pv);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
120 return -1;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
121 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
122 free(pv);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
123 return 0;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
124 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
125
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
126 static struct option long_options[] =
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
127 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
128 { "help", no_argument, NULL, 'h' },
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
129 { "driver", required_argument, NULL, 'd' },
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
130 { "fourcc", required_argument, NULL, 'f' },
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
131 { "save", required_argument, NULL, 's' },
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
132 { "check", required_argument, NULL, 'c' },
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
133 { "view", no_argument, NULL, 'v' },
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
134 { 0, 0, 0, 0 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
135 };
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
136
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
137 void help(const char *progname)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
138 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
139 printf("VFW to mencoder - Copyright 2006 - Gianluigi Tiesi <sherpya@netfarm.it>\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
140 printf("This program is Free Software\n\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
141 printf("Usage: %s\n", progname);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
142 printf(" -h|--help - displays this help\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
143 printf(" -d|--driver filename - dll or drv to load\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
144 printf(" -f|--fourcc fourcc - fourcc of selected driver (look at codecs.conf)\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
145 printf(" -s|--save filename - save settings to file\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
146 printf(" -c|--check filename - load and show setting in filename\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
147 printf(" -v|--view - displays the config dialog and do nothing\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
148 printf("\nExamples:\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
149 printf(" %s -f VP62 -d vp6vfw.dll -s firstpass.mcf\n", progname);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
150 printf(" %s -f VP62 -d vp6vfw.dll -c firstpass.mcf\n", progname);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
151 printf(" %s -f VP62 -d vp6vfw.dll -v\n", progname);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
152 printf("\nIf the driver dialog doesn't work, you can try without specifing a fourcc,\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
153 printf("but the compdata file will not work with mencoder.\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
154 printf("Driver option is required and you must specify at least -s, -c -o -v\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
155 printf("Usage with mencoder -ovc vfw -xvfwopts codec=vp6vfw.dll:compdata=settings.mcf\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
156 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
157
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
158
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
159 int main(int argc, char *argv[])
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
160 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
161 char *driver = NULL;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
162 char *fourcc = NULL;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
163 char *filename = NULL;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
164 unsigned char mode = 0;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
165
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
166 wchar_t drvfile[MAX_PATH];
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
167 HDRVR hDriver = NULL;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
168 int ret = 0;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
169 int c = -1, long_options_index = -1;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
170
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
171 if (argc < 2)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
172 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
173 help(argv[0]);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
174 ret = -1;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
175 goto cleanup;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
176 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
177
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
178 while ((c = getopt_long(argc, argv, "hd:f:s:c:v", long_options, &long_options_index)) != -1)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
179 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
180 switch (c)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
181 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
182 case 'h':
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
183 help(argv[0]);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
184 ret = 0;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
185 goto cleanup;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
186 case 'd':
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
187 driver = strdup(optarg);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
188 break;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
189 case 'f':
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
190 fourcc = strdup(optarg);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
191 if (strlen(optarg) != 4) BAIL("Fourcc must be exactly 4 chars");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
192 break;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
193 case 's':
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
194 if (mode != MODE_NONE) BAIL("Incompatible arguments");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
195 filename = strdup(optarg);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
196 mode = MODE_SAVE;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
197 break;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
198 case 'c':
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
199 if (mode != MODE_NONE) BAIL("Incompatible arguments");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
200 filename = strdup(optarg);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
201 mode = MODE_CHECK;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
202 break;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
203 case 'v':
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
204 if (mode != MODE_NONE) BAIL("Incompatible arguments");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
205 mode = MODE_VIEW;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
206 break;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
207 default:
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
208 printf("Wrong arguments!\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
209 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
210 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
211
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
212
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
213 if (!(argc == optind) && (mode != MODE_NONE) &&
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
214 driver && (filename || (mode == MODE_VIEW)))
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
215 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
216 help(argv[0]);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
217 goto cleanup;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
218 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
219
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
220 if (!MultiByteToWideChar(CP_ACP, 0, driver, -1, drvfile, MAX_PATH))
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
221 BAIL("MultiByteToWideChar() failed\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
222
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
223 if (!(hDriver = OpenDriver(drvfile, 0, (fourcc) ? ((LPARAM) fourcc) : 0)))
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
224 BAIL("OpenDriver() failed\n");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
225
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
226 if (SendDriverMessage(hDriver, ICM_CONFIGURE, -1, 0) != ICERR_OK)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
227 BAIL("The driver doesn't provide a configure dialog");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
228
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
229 switch(mode)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
230 {
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
231 case MODE_CHECK:
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
232 if (load_settings(hDriver, filename))
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
233 BAIL("Cannot load settings from file");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
234 if (SendDriverMessage(hDriver, ICM_CONFIGURE, 0, 0) != ICERR_OK)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
235 BAIL("ICM_CONFIGURE failed");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
236 break;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
237 case MODE_SAVE:
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
238 if (SendDriverMessage(hDriver, ICM_CONFIGURE, 0, 0) != ICERR_OK)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
239 BAIL("ICM_CONFIGURE failed");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
240 if (save_settings(hDriver, filename))
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
241 BAIL("Cannot save settings to file");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
242 break;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
243 case MODE_VIEW:
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
244 if (SendDriverMessage(hDriver, ICM_CONFIGURE, 0, 0) != ICERR_OK)
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
245 BAIL("ICM_CONFIGURE failed");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
246 break;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
247 default:
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
248 BAIL("This should not happen :)");
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
249 }
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
250
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
251 cleanup:
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
252 if (driver) free(driver);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
253 if (fourcc) free(fourcc);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
254 if (filename) free(filename);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
255 if (hDriver) CloseDriver(hDriver, 0, 0);
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
256 return ret;
c5a591c4a372 Controllable quality setting of VFW enconding, through the dumped state of the dialog box. Patch by Gianluigi Tiesi
alex
parents:
diff changeset
257 }