/
avidemux_main.c
52 lines (42 loc) · 1006 Bytes
/
avidemux_main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> /* sleep */
#include <sys/time.h>
#include <string.h>
#define streq(a, b) (strcmp(a, b) == 0 ? 1 : 0)
#include "CTI.h"
#include "AVIDemux.h"
int main(int argc, char *argv[])
{
int i;
int T = 0;
char *alsadev = "hw:0";
printf("This is %s\n", argv[0]);
for (i=0; i < argc; i++) {
if (strncmp(argv[i], "hw:", 3) == 0) {
alsadev = argv[i];
}
else if (streq(argv[i], "T")) {
T = 1;
}
}
AVIDemux_init();
Template_list(1);
Instance *ad = Instantiate("AVIDemux");
printf("instance: %s\n", ad->label);
SetConfig(ad, "input", "sample.avi");
Instance_loop_thread(ad);
/* Wait loop. Hm, might as well run a console of sorts... */
while (1) {
char buffer[256];
printf("avidemux>"); fflush(stdout);
fgets(buffer, sizeof(buffer), stdin);
if (buffer[0]) {
buffer[strlen(buffer)-1] = 0;
}
if (streq(buffer, "quit")) {
break;
}
}
return 0;
}