Index: Makefile =================================================================== RCS file: /cvsroot/pkgsrc/multimedia/mpv/Makefile,v retrieving revision 1.55 diff -u -p -r1.55 Makefile --- Makefile 24 Apr 2017 15:18:01 -0000 1.55 +++ Makefile 2 May 2017 07:40:18 -0000 @@ -1,6 +1,7 @@ # $NetBSD: Makefile,v 1.55 2017/04/24 15:18:01 maya Exp $ DISTNAME= mpv-0.25.0 +PKGREVISION= 1 CATEGORIES= multimedia MASTER_SITES= ${MASTER_SITE_GITHUB:=mpv-player/} GITHUB_TAG= v${PKGVERSION_NOREV} Index: distinfo =================================================================== RCS file: /cvsroot/pkgsrc/multimedia/mpv/distinfo,v retrieving revision 1.34 diff -u -p -r1.34 distinfo --- distinfo 24 Apr 2017 15:18:01 -0000 1.34 +++ distinfo 2 May 2017 07:40:18 -0000 @@ -4,4 +4,5 @@ SHA1 (mpv-0.25.0.tar.gz) = fe98e9afe0a5e RMD160 (mpv-0.25.0.tar.gz) = fd9c2ebe95ae121de8f2f17aa4e36711457ed758 SHA512 (mpv-0.25.0.tar.gz) = eefc574e2995ddf6bd15c9b62986a5ca277c30949b036d57a11bbfb796c11c1e6dd7c313abd91a909dd98ca0f2b0be29ec6b980d0287a5891b42b0ffba926cbf Size (mpv-0.25.0.tar.gz) = 2874584 bytes +SHA1 (patch-audio_out_ao__oss.c) = 518f87f39e56d764046a198a9f9429e3c051d67a SHA1 (patch-player_main.c) = 842432e448526a9d170e7efd2b01276e36072e16 Index: patches/patch-audio_out_ao__oss.c =================================================================== RCS file: patches/patch-audio_out_ao__oss.c diff -N patches/patch-audio_out_ao__oss.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-audio_out_ao__oss.c 2 May 2017 07:40:18 -0000 @@ -0,0 +1,40 @@ +$NetBSD$ + +ioctl(..., SNDCTL_DSP_CHANNELS, &nchannels) for not supported nchannels does not +return an error and instead set nchannels to the default value. Instead of +failing with no audio, fallback to stereo or mono. + +Fallback logic inspired by `OSS v3 Programmer's guide', p. 34. + +--- audio/out/ao_oss.c.orig 2017-02-12 01:31:16.000000000 +0000 ++++ audio/out/ao_oss.c +@@ -345,13 +345,26 @@ static int reopen_device(struct ao *ao, + // We only use SNDCTL_DSP_CHANNELS for >2 channels, in case some drivers don't have it + if (reqchannels > 2) { + int nchannels = reqchannels; +- if (ioctl(p->audio_fd, SNDCTL_DSP_CHANNELS, &nchannels) == -1 || +- nchannels != reqchannels) +- { ++ if (ioctl(p->audio_fd, SNDCTL_DSP_CHANNELS, &nchannels) == -1) { + MP_ERR(ao, "Failed to set audio device to %d channels.\n", + reqchannels); + goto fail; + } ++ if (nchannels != reqchannels) { ++ // Fallback to stereo or mono ++ int c; ++ for (nchannels = c = 2; c >= 1; c--, nchannels--) { ++ if (ioctl(p->audio_fd, SNDCTL_DSP_CHANNELS, &c) == -1) { ++ MP_ERR(ao, "Failed to set audio device to %d channels.\n", c); ++ goto fail; ++ } ++ if (c == nchannels) ++ break; ++ } ++ if (!ao_chmap_sel_get_def(ao, &sel, &channels, c)) ++ goto fail; ++ MP_WARN(ao, "using %d channels (requested: %d)\n", channels.num, reqchannels); ++ } + } else { + int c = reqchannels - 1; + if (ioctl(p->audio_fd, SNDCTL_DSP_STEREO, &c) == -1) {