pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/audio/musicpd



Module Name:    pkgsrc
Committed By:   nia
Date:           Tue Apr 14 12:55:04 UTC 2020

Modified Files:
        pkgsrc/audio/musicpd: Makefile distinfo
Added Files:
        pkgsrc/audio/musicpd/patches:
            patch-src_output_plugins_SolarisOutputPlugin.cxx

Log Message:
musicpd: Various improvements in SolarisOutputPlugin

- Use AUDIO_INITINFO rather than AUDIO_GETINFO for initialization
  This is recommended by Solaris and NetBSD documentation.
- Don't open the device with O_NONBLOCK then remove the flag.
  AFAIK this is a workaround for old implementations that wouldn't
  allow the device to be opened in blocking mode if it was already
  in use. Either way, it hasn't been necessary for a long time.
- Support S8 and S32 audio formats.


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 pkgsrc/audio/musicpd/Makefile
cvs rdiff -u -r1.112 -r1.113 pkgsrc/audio/musicpd/distinfo
cvs rdiff -u -r0 -r1.4 \
    pkgsrc/audio/musicpd/patches/patch-src_output_plugins_SolarisOutputPlugin.cxx

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/audio/musicpd/Makefile
diff -u pkgsrc/audio/musicpd/Makefile:1.214 pkgsrc/audio/musicpd/Makefile:1.215
--- pkgsrc/audio/musicpd/Makefile:1.214 Sun Apr 12 08:28:19 2020
+++ pkgsrc/audio/musicpd/Makefile       Tue Apr 14 12:55:04 2020
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.214 2020/04/12 08:28:19 adam Exp $
+# $NetBSD: Makefile,v 1.215 2020/04/14 12:55:04 nia Exp $
 
 DISTNAME=      mpd-0.21.22
 PKGNAME=       ${DISTNAME:S/mpd/musicpd/}
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    audio
 MASTER_SITES=  https://www.musicpd.org/download/mpd/0.21/
 EXTRACT_SUFX=  .tar.xz

Index: pkgsrc/audio/musicpd/distinfo
diff -u pkgsrc/audio/musicpd/distinfo:1.112 pkgsrc/audio/musicpd/distinfo:1.113
--- pkgsrc/audio/musicpd/distinfo:1.112 Sun Apr  5 13:33:41 2020
+++ pkgsrc/audio/musicpd/distinfo       Tue Apr 14 12:55:04 2020
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.112 2020/04/05 13:33:41 nia Exp $
+$NetBSD: distinfo,v 1.113 2020/04/14 12:55:04 nia Exp $
 
 SHA1 (mpd-0.21.22.tar.xz) = 51a2965f6c14c27f5de7d96e7e80a7f5b387edf1
 RMD160 (mpd-0.21.22.tar.xz) = 1fe7d8193c52b0d65382ed990e2fd2b9692414ca
 SHA512 (mpd-0.21.22.tar.xz) = 051d97500d8224fe4769a667a58c7915eebcca809e9345a30881f99d7c33d99907d9cc0258c0a5fd20f10609edbeb6da16941099ac3c033762ceb4b116e4df04
 Size (mpd-0.21.22.tar.xz) = 679244 bytes
 SHA1 (patch-src_net_IPv6Address.hxx) = c9e9a5676451e6834fcef359266d37fc15f079e6
+SHA1 (patch-src_output_plugins_SolarisOutputPlugin.cxx) = a72534ddac7b695623841eb53f0520aae6870b28

Added files:

Index: pkgsrc/audio/musicpd/patches/patch-src_output_plugins_SolarisOutputPlugin.cxx
diff -u /dev/null pkgsrc/audio/musicpd/patches/patch-src_output_plugins_SolarisOutputPlugin.cxx:1.4
--- /dev/null   Tue Apr 14 12:55:04 2020
+++ pkgsrc/audio/musicpd/patches/patch-src_output_plugins_SolarisOutputPlugin.cxx       Tue Apr 14 12:55:04 2020
@@ -0,0 +1,70 @@
+$NetBSD: patch-src_output_plugins_SolarisOutputPlugin.cxx,v 1.4 2020/04/14 12:55:04 nia Exp $
+
+- Use AUDIO_INITINFO rather than AUDIO_GETINFO for initialization
+- Don't open the device in non-blocking mode, no OS has needed this for years
+- Support S8 and S32 formats
+
+https://github.com/MusicPlayerDaemon/MPD/pull/826
+
+--- src/output/plugins/SolarisOutputPlugin.cxx.orig    2020-04-02 15:48:56.000000000 +0000
++++ src/output/plugins/SolarisOutputPlugin.cxx
+@@ -43,6 +43,7 @@
+ #define I_FLUSH 0
+ #endif
+ 
++#define AUDIO_INITINFO(v)
+ #define AUDIO_GETINFO 0
+ #define AUDIO_SETINFO 0
+ #define AUDIO_ENCODING_LINEAR 0
+@@ -93,33 +94,31 @@ SolarisOutput::Open(AudioFormat &audio_f
+       struct audio_info info;
+       int ret;
+ 
+-      /* support only 16 bit mono/stereo for now; nothing else has
+-         been tested */
+-      audio_format.format = SampleFormat::S16;
++      AUDIO_INITINFO(&info);
+ 
+-      /* open the device in non-blocking mode */
+-
+-      if (!fd.Open(device, O_WRONLY|O_NONBLOCK))
+-              throw FormatErrno("Failed to open %s",
+-                                device);
+-
+-      /* restore blocking mode */
+-
+-      fd.SetBlocking();
++      if (!fd.Open(device, O_WRONLY))
++              throw FormatErrno("Failed to open %s", device);
+ 
+       /* configure the audio device */
+ 
+-      ret = ioctl(fd.Get(), AUDIO_GETINFO, &info);
+-      if (ret < 0) {
+-              const int e = errno;
+-              fd.Close();
+-              throw MakeErrno(e, "AUDIO_GETINFO failed");
++#ifdef AUMODE_PLAY
++      info.mode = AUMODE_PLAY; /* BSD extension */
++#endif
++      info.play.encoding = AUDIO_ENCODING_LINEAR;
++      switch (audio_format.format) {
++      case SampleFormat::S8:
++              info.play.precision = 8;
++              break;
++      case SampleFormat::S16:
++              info.play.precision = 16;
++              break;
++      default:
++              info.play.precision = 32;
++              audio_format.format = SampleFormat::S32;
++              break;
+       }
+-
+       info.play.sample_rate = audio_format.sample_rate;
+       info.play.channels = audio_format.channels;
+-      info.play.precision = 16;
+-      info.play.encoding = AUDIO_ENCODING_LINEAR;
+ 
+       ret = ioctl(fd.Get(), AUDIO_SETINFO, &info);
+       if (ret < 0) {



Home | Main Index | Thread Index | Old Index