socsvn commit: r305555 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve
iateaca at FreeBSD.org
iateaca at FreeBSD.org
Sun Jun 26 10:27:19 UTC 2016
Author: iateaca
Date: Sun Jun 26 10:27:17 2016
New Revision: 305555
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=305555
Log:
check the audio context is initialized when try to start it
M bhyve/hda_codec.c
Modified:
soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c
Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c
==============================================================================
--- soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c Sun Jun 26 00:53:31 2016 (r305554)
+++ soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c Sun Jun 26 10:27:17 2016 (r305555)
@@ -78,6 +78,7 @@
typedef int (*setup_func_t)(void *arg);
struct hda_audio_ctxt {
+ uint8_t started;
char name[64];
uint8_t run;
pthread_t tid;
@@ -389,6 +390,8 @@
{
uint8_t div = 0;
+ assert(params);
+
/* Compute the Sample Rate */
params->rate = (fmt & HDA_CODEC_FMT_BASE_MASK) ? 44100 : 48000;
@@ -568,6 +571,8 @@
pthread_set_name_np(actx->tid, tname);
assert(!err);
+ actx->started = 1;
+
return 0;
}
@@ -576,6 +581,9 @@
{
int err = 0;
+ assert(actx);
+ assert(actx->started);
+
/* The stream is supposed to be stopped */
if (actx->run)
return -1;
More information about the svn-soc-all
mailing list