Package: osdsh / 0.7.0-10.2

06-fix-m-option.dpatch Patch series | download
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From: Joachim Breitner <nomeata@debian.org>
Subject: some hacks to actually enable setting mixer device via command line

--- a/src/osdsh/controlsh.c
+++ b/src/osdsh/controlsh.c
@@ -15,6 +15,8 @@
     char file[PATH_MAX+256];
     char *msg = NULL;
 
+    char **mod_mixerdev;
+
 
 /*    getcwd(file, PATH_MAX);
     strcat(file, "/");
@@ -41,6 +43,9 @@
 
 	info = dlsym(module, "mynameis");
 
+	mod_mixerdev = dlsym(module, "mixerdevice");
+	*mod_mixerdev = mixerdevice;
+
 	plugins[a].module = module;
 	plugins[a].whoami = a;
 	plugins[a].file = file;
--- a/src/osdsh/mixerwatch.c
+++ b/src/osdsh/mixerwatch.c
@@ -3,7 +3,8 @@
 #define IAM 0
 #define MYNAME "Mixer"
 
-char mixerdevice[PATH_MAX+1] = MIXER;
+// globally defined by Joachim
+// char mixerdevice[PATH_MAX+1] = MIXER;
 int dev;
 settings_t mixerset;
 int vol[SOUND_MIXER_NRDEVICES];
--- a/src/osdsh/osdsh.c
+++ b/src/osdsh/osdsh.c
@@ -91,12 +91,10 @@
 	case 'd':
 	    settings->delay = atoi(optarg);
 	    break;
-/*
 	case 'm':
-	    strncpy(messages.mixerdevice, optarg, BUFSIZ);
-	    messages.mixerdevice[PATH_MAX+1] = '\0';
+	    strncpy(mixerdevice, optarg, PATH_MAX);
+	    mixerdevice[PATH_MAX] = '\0';
 	    break;
-*/
 	case 'o':
 	    settings->soffset = atoi(optarg);
 	    break;
@@ -158,6 +156,11 @@
     set_defaults(&settings);
     initialize_osd(&settings);
 
+    /* HACK */
+    strncpy(mixerdevice, MIXER, PATH_MAX);
+    mixerdevice[PATH_MAX] = '\0';
+
+
     parse_args(argc, argv, &settings);
 /*
 #ifndef NOAPM
--- a/src/osdsh/osdsh.h
+++ b/src/osdsh/osdsh.h
@@ -44,3 +44,5 @@
     int (*isitmine)();
 } plugininfo_t;
 
+/* HACK */
+char mixerdevice[PATH_MAX + 1];