Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102652648
D44852.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D44852.diff
View Options
diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h
--- a/sys/dev/sound/pcm/sound.h
+++ b/sys/dev/sound/pcm/sound.h
@@ -175,6 +175,9 @@
#define PCM_DETACHING(x) ((x)->flags & SD_F_DETACHING)
+#define PCM_CHANCOUNT(d) \
+ (d->playcount + d->pvchancount + d->reccount + d->rvchancount)
+
/* many variables should be reduced to a range. Here define a macro */
#define RANGE(var, low, high) (var) = \
(((var)<(low))? (low) : ((var)>(high))? (high) : (var))
@@ -367,7 +370,7 @@
} opened;
} pcm;
} channels;
- unsigned devcount, playcount, reccount, pvchancount, rvchancount ;
+ unsigned playcount, reccount, pvchancount, rvchancount;
unsigned flags;
unsigned int bufsz;
void *devinfo;
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -602,8 +602,6 @@
break;
}
- d->devcount++;
-
return (0);
}
@@ -644,8 +642,6 @@
break;
}
- d->devcount--;
-
return (0);
}
@@ -947,7 +943,6 @@
d->flags |= SD_F_BITPERFECT;
d->devinfo = devinfo;
- d->devcount = 0;
d->reccount = 0;
d->playcount = 0;
d->pvchancount = 0;
@@ -1116,7 +1111,7 @@
PCM_UNLOCKASSERT(d);
PCM_LOCK(d);
- si->numaudios += d->devcount;
+ si->numaudios += PCM_CHANCOUNT(d);
++ncards;
CHN_FOREACH(c, d, channels.pcm) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 9:20 AM (21 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14656480
Default Alt Text
D44852.diff (1 KB)
Attached To
Mode
D44852: sound: Get rid of snddev_info->devcount
Attached
Detach File
Event Timeline
Log In to Comment