audio/libmatemixer: help mate_mixer_applet to save the "track to control"

- Using mate 1.8.1 installed from packages.
  Unable to set the volume straight from the slider of the Mixer Applet,
  until I right click the icon, go to preferences, and select PCM as the
  track to control. If I restart the mate_mixer_applet
  (either via kill or regular shutdown) the setting goes back to Volume.
- After the port patch the instelled libmatemixer backend works fine.
- see also:
  https://forums.freebsd.org/threads/fixing-default-audio-device-in-mate.58957/

PR:		202578
Submitted by:	Attila <agm2port@gmail.com>
Reported by:	Abilio Marques <abiliojr@gmail.com>
Reviewed by:	Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>
This commit is contained in:
Kurt Jaeger 2019-02-11 06:37:55 +00:00
parent 4c9f33828d
commit 532827dfe5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=492669

View File

@ -0,0 +1,30 @@
--- backends/oss/oss-backend.c.orig 2017-03-12 15:28:02 UTC
+++ backends/oss/oss-backend.c
@@ -40,6 +40,8 @@
* from the sndstat file, but avoid even trying that on systems where this
* is not needed and the file is not present */
#define OSS_PATH_SNDSTAT "/dev/sndstat"
+ /* remove SOUND_MIXER_INFO on FreeBSD, use OSS_PATH_SNDSTAT */
+#undef SOUND_MIXER_INFO
#endif
#define OSS_MAX_DEVICES 32
@@ -377,6 +379,10 @@ read_device_label (OssBackend *oss, cons
{
guint index;
+ /* default_device setting only in read_device_label_sndstat()
+ * on FreeBSD use OSS_PATH_SNDSTAT
+ */
+
#ifdef SOUND_MIXER_INFO
do {
struct mixer_info info;
@@ -430,6 +436,7 @@ read_device_label_sndstat (OssBackend *
while (fgets (line, sizeof (line), fp) != NULL) {
gchar *p;
+ g_strchomp(line); // required for g_str_has_suffix()
if (g_str_has_prefix (line, prefix) == FALSE)
continue;