diff options
author | Garrett D'Amore <gdamore@opensolaris.org> | 2009-07-24 00:14:09 -0700 |
---|---|---|
committer | Garrett D'Amore <gdamore@opensolaris.org> | 2009-07-24 00:14:09 -0700 |
commit | 622a30bf9ccf91e4468f9c8a7f5e60d628fee4b2 (patch) | |
tree | b2cbdc84f35505470f54197ce4345b77ffbc8c3f /usr | |
parent | ad593b7f6950a2f44f8c46948367d37431f74fd0 (diff) | |
download | illumos-joyent-622a30bf9ccf91e4468f9c8a7f5e60d628fee4b2.tar.gz |
6863438 AUDIO_GETINFO always returns a non-0 'play.active' value
Diffstat (limited to 'usr')
-rw-r--r-- | usr/src/uts/common/io/audio/impl/audio_client.c | 6 | ||||
-rw-r--r-- | usr/src/uts/common/io/audio/impl/audio_client.h | 1 | ||||
-rw-r--r-- | usr/src/uts/common/io/audio/impl/audio_sun.c | 24 |
3 files changed, 27 insertions, 4 deletions
diff --git a/usr/src/uts/common/io/audio/impl/audio_client.c b/usr/src/uts/common/io/audio/impl/audio_client.c index c088a49ad2..e6c354ae14 100644 --- a/usr/src/uts/common/io/audio/impl/audio_client.c +++ b/usr/src/uts/common/io/audio/impl/audio_client.c @@ -743,6 +743,12 @@ auclnt_get_muted(audio_stream_t *sp) return (sp->s_muted); } +boolean_t +auclnt_is_running(audio_stream_t *sp) +{ + return (sp->s_running); +} + void auclnt_start(audio_stream_t *sp) { diff --git a/usr/src/uts/common/io/audio/impl/audio_client.h b/usr/src/uts/common/io/audio/impl/audio_client.h index 6d22249534..edee62ae7d 100644 --- a/usr/src/uts/common/io/audio/impl/audio_client.h +++ b/usr/src/uts/common/io/audio/impl/audio_client.h @@ -84,6 +84,7 @@ void auclnt_set_errors(audio_stream_t *, uint64_t); uint64_t auclnt_get_eof(audio_stream_t *); void auclnt_set_eof(audio_stream_t *, uint64_t); +boolean_t auclnt_is_running(audio_stream_t *); void auclnt_start(audio_stream_t *); void auclnt_stop(audio_stream_t *); diff --git a/usr/src/uts/common/io/audio/impl/audio_sun.c b/usr/src/uts/common/io/audio/impl/audio_sun.c index fdefd957ff..c0d5b9d9be 100644 --- a/usr/src/uts/common/io/audio/impl/audio_sun.c +++ b/usr/src/uts/common/io/audio/impl/audio_sun.c @@ -585,10 +585,18 @@ devaudio_proc_update(daproc_t *proc) info->play.gain = (auclnt_get_gain(sp) * AUDIO_MAX_GAIN) / 100; info->play.pause = auclnt_is_paused(sp); - info->play.active = !info->play.pause; + info->play.active = auclnt_is_running(sp); info->play.samples = auclnt_get_samples(sp); info->play.error = auclnt_get_errors(sp) ? B_TRUE : B_FALSE; info->output_muted = auclnt_get_muted(sp); + } else { + info->play.encoding = AUDIO_ENCODING_NONE; + info->play.precision = 0; + info->play.sample_rate = 0; + info->play.pause = B_FALSE; + info->play.active = B_FALSE; + info->play.error = B_FALSE; + info->play.samples = 0; } if ((c = proc->p_reader) != NULL) { @@ -601,9 +609,17 @@ devaudio_proc_update(daproc_t *proc) info->record.gain = (auclnt_get_gain(sp) * AUDIO_MAX_GAIN) / 100; info->record.pause = auclnt_is_paused(sp); - info->record.active = !info->record.pause; + info->record.active = auclnt_is_running(sp); info->record.samples = auclnt_get_samples(sp); info->record.error = auclnt_get_errors(sp) ? B_TRUE : B_FALSE; + } else { + info->record.encoding = AUDIO_ENCODING_NONE; + info->record.precision = 0; + info->record.sample_rate = 0; + info->record.pause = B_FALSE; + info->record.active = B_FALSE; + info->record.error = B_FALSE; + info->record.samples = 0; } } @@ -852,7 +868,7 @@ devaudio_ioc_setinfo(queue_t *wq, audio_client_t *c, mblk_t *mp) opr->buffer_size = npr->buffer_size; } } else { - /* these vaalues are preserved even if /dev/audio not open */ + /* these values are preserved even if /dev/audio not open */ if (CHANGED(npr, opr, gain)) { opr->gain = npr->gain; } @@ -913,7 +929,7 @@ devaudio_ioc_setinfo(queue_t *wq, audio_client_t *c, mblk_t *mp) devaudio_proc_update(dc->dc_proc); bcopy(&dc->dc_proc->p_info, ninfo, sizeof (*ninfo)); - + mutex_exit(&dc->dc_dev->d_mx); mcopyout(mp, NULL, sizeof (audio_info_t), uaddr, bcont); qreply(wq, mp); |