Date: Sun, 26 Jun 2016 10:27:18 GMT From: iateaca@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r305555 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve Message-ID: <201606261027.u5QARID9070636@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606261027.u5QARID9070636>