diff options
author | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-10-01 11:44:22 +0000 |
---|---|---|
committer | Ronald S. Bultje <rbultje@ronald.bitfreak.net> | 2004-10-01 11:44:22 +0000 |
commit | e2513e5415199fa6b0bbeaf06a8eb827debbbb0b (patch) | |
tree | 344d720038023a6de2739ed44e5cfb7c602dbea0 /sys | |
parent | 1b6c3e0efa775296d2c814882c3feb2ce35b7539 (diff) | |
download | gst-plugins-bad-e2513e5415199fa6b0bbeaf06a8eb827debbbb0b.tar.gz gst-plugins-bad-e2513e5415199fa6b0bbeaf06a8eb827debbbb0b.tar.bz2 gst-plugins-bad-e2513e5415199fa6b0bbeaf06a8eb827debbbb0b.zip |
sys/sunaudio/gstsunaudio.c: Solve #152805.
Original commit message from CVS:
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* sys/sunaudio/gstsunaudio.c: (gst_sunaudiosink_setparams):
Solve #152805.
* sys/sunaudio/gstsunmixer.c: (gst_sunaudiomixer_set_mute):
Solve 152806.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sunaudio/gstsunaudio.c | 15 | ||||
-rw-r--r-- | sys/sunaudio/gstsunmixer.c | 6 |
2 files changed, 15 insertions, 6 deletions
diff --git a/sys/sunaudio/gstsunaudio.c b/sys/sunaudio/gstsunaudio.c index 057ec2bc..42c8bc86 100644 --- a/sys/sunaudio/gstsunaudio.c +++ b/sys/sunaudio/gstsunaudio.c @@ -276,6 +276,19 @@ gst_sunaudiosink_setparams (GstSunAudioSink * sunaudiosink) { audio_info_t ainfo; int ret; + int ports; + + ret = ioctl (sunaudiosink->fd, AUDIO_GETINFO, &ainfo); + if (ret == -1) { + GST_ELEMENT_ERROR (sunaudiosink, RESOURCE, SETTINGS, (NULL), ("%s", + strerror (errno))); + return FALSE; + } + + ports = ainfo.play.port; + if (!(ports & AUDIO_SPEAKER) && (ainfo.play.avail_ports & AUDIO_SPEAKER)) { + ports = ports | AUDIO_SPEAKER; + } AUDIO_INITINFO (&ainfo); @@ -283,7 +296,7 @@ gst_sunaudiosink_setparams (GstSunAudioSink * sunaudiosink) ainfo.play.channels = sunaudiosink->channels; ainfo.play.precision = sunaudiosink->width; ainfo.play.encoding = AUDIO_ENCODING_LINEAR; - ainfo.play.port = AUDIO_SPEAKER; + ainfo.play.port = ports; ainfo.play.buffer_size = sunaudiosink->buffer_size; ainfo.output_muted = 0; diff --git a/sys/sunaudio/gstsunmixer.c b/sys/sunaudio/gstsunmixer.c index f79b7725..6f0db25e 100644 --- a/sys/sunaudio/gstsunmixer.c +++ b/sys/sunaudio/gstsunmixer.c @@ -130,8 +130,7 @@ fill_labels (void) { gchar *given, *wanted; } - cases[] = - { + cases[] = { { "Vol ", N_("Volume")} , { @@ -279,13 +278,10 @@ gst_sunaudiomixer_set_mute (GstMixer * mixer, return; AUDIO_INITINFO (&audioinfo); - ioctl (sunaudio->mixer_fd, AUDIO_GETINFO, &audioinfo); if (mute) { - audioinfo.play.port = audioinfo.play.avail_ports; audioinfo.output_muted = 1; } else { - audioinfo.play.port = 0; audioinfo.output_muted = 0; } |