pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/multimedia/mpv
Module Name: pkgsrc
Committed By: nia
Date: Wed Apr 8 12:17:02 UTC 2020
Modified Files:
pkgsrc/multimedia/mpv: Makefile distinfo
pkgsrc/multimedia/mpv/patches: patch-audio_out_ao__netbsd.c
Log Message:
mpv: ao_netbsd improvements. Fixes playing very small audio files.
- Get the preferred sample rate from the device.
This ensures sample rate conversion is done in user space,
which is a Good Idea and should improve output quality.
This backend is now Even More NetBSD.
- Implement drain().
- Bump up the buffer size.
Bump PKGREVISION
To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 pkgsrc/multimedia/mpv/Makefile
cvs rdiff -u -r1.63 -r1.64 pkgsrc/multimedia/mpv/distinfo
cvs rdiff -u -r1.3 -r1.4 \
pkgsrc/multimedia/mpv/patches/patch-audio_out_ao__netbsd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/multimedia/mpv/Makefile
diff -u pkgsrc/multimedia/mpv/Makefile:1.105 pkgsrc/multimedia/mpv/Makefile:1.106
--- pkgsrc/multimedia/mpv/Makefile:1.105 Tue Apr 7 13:47:04 2020
+++ pkgsrc/multimedia/mpv/Makefile Wed Apr 8 12:17:02 2020
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.105 2020/04/07 13:47:04 ryoon Exp $
+# $NetBSD: Makefile,v 1.106 2020/04/08 12:17:02 nia Exp $
DISTNAME= mpv-0.32.0
-PKGREVISION= 7
+PKGREVISION= 8
CATEGORIES= multimedia
MASTER_SITES= ${MASTER_SITE_GITHUB:=mpv-player/}
GITHUB_TAG= v${PKGVERSION_NOREV}
Index: pkgsrc/multimedia/mpv/distinfo
diff -u pkgsrc/multimedia/mpv/distinfo:1.63 pkgsrc/multimedia/mpv/distinfo:1.64
--- pkgsrc/multimedia/mpv/distinfo:1.63 Wed Mar 18 11:49:21 2020
+++ pkgsrc/multimedia/mpv/distinfo Wed Apr 8 12:17:02 2020
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.63 2020/03/18 11:49:21 leot Exp $
+$NetBSD: distinfo,v 1.64 2020/04/08 12:17:02 nia Exp $
SHA1 (mpv-0.32.0.tar.gz) = 5b69ea34dd5f8d209acd5266415c7bc00ab83341
RMD160 (mpv-0.32.0.tar.gz) = d1e399fce8985a0399fe627248b87d8537cfefd7
@@ -7,7 +7,7 @@ Size (mpv-0.32.0.tar.gz) = 3148730 bytes
SHA1 (patch-DOCS_man_ao.rst) = 5940fe1ad4d4328c03b9e6e5265c517762cfe2d0
SHA1 (patch-audio_out_ao.c) = 1527c818d0f50801485ad3b90c5d86b30b2ca6f1
SHA1 (patch-audio_out_ao__alsa.c) = c4661d0d22550d6e4eb2b7a42dd04dbcc58123b0
-SHA1 (patch-audio_out_ao__netbsd.c) = 544b976fae4d672a4f99b226b949f5f338712820
+SHA1 (patch-audio_out_ao__netbsd.c) = 1a88957a89dd8ebffaeadb14463c16796eb444d3
SHA1 (patch-options_options.c) = c75fb27140ad21e0a11c6ded976116c544661f56
SHA1 (patch-player_main.c) = 7d1d62091c327fca698844004ddb9a7871e15fce
SHA1 (patch-video_out_drm__common.c) = a545a8aec29f1b3c44d26aacbc59b86d3333a0b9
Index: pkgsrc/multimedia/mpv/patches/patch-audio_out_ao__netbsd.c
diff -u pkgsrc/multimedia/mpv/patches/patch-audio_out_ao__netbsd.c:1.3 pkgsrc/multimedia/mpv/patches/patch-audio_out_ao__netbsd.c:1.4
--- pkgsrc/multimedia/mpv/patches/patch-audio_out_ao__netbsd.c:1.3 Wed Mar 18 11:49:21 2020
+++ pkgsrc/multimedia/mpv/patches/patch-audio_out_ao__netbsd.c Wed Apr 8 12:17:02 2020
@@ -1,10 +1,10 @@
-$NetBSD: patch-audio_out_ao__netbsd.c,v 1.3 2020/03/18 11:49:21 leot Exp $
+$NetBSD: patch-audio_out_ao__netbsd.c,v 1.4 2020/04/08 12:17:02 nia Exp $
NetBSD audio support.
---- audio/out/ao_netbsd.c.orig 2020-03-18 11:11:11.484992180 +0000
+--- audio/out/ao_netbsd.c.orig 2020-04-08 12:06:20.470592603 +0000
+++ audio/out/ao_netbsd.c
-@@ -0,0 +1,263 @@
+@@ -0,0 +1,276 @@
+/*
+ * Copyright (c) 2020 Nia Alarie <nia%NetBSD.org@localhost>
+ * All rights reserved.
@@ -50,12 +50,8 @@ NetBSD audio support.
+#define NETBSD_MAX_DEVS (8)
+#endif
+
-+#ifndef NETBSD_MAX_CHANNELS
-+#define NETBSD_MAX_CHANNELS (12)
-+#endif
-+
-+#ifndef NETBSD_BUF_FRAMES
-+#define NETBSD_BUF_FRAMES (32)
++#ifndef NETBSD_BUF_SIZE
++#define NETBSD_BUF_SIZE (1024)
+#endif
+
+struct priv {
@@ -69,10 +65,12 @@ NetBSD audio support.
+ char device[16] = "/dev/audio";
+ struct priv *p = ao->priv;
+ struct audio_info info;
++ struct audio_info hw_info;
+ struct audio_prinfo *pinfo;
+ struct mp_chmap_sel sel = {0};
+
+ AUDIO_INITINFO(&info);
++ AUDIO_INITINFO(&hw_info);
+ pinfo = &info.play;
+
+ if (ao->device != NULL) {
@@ -87,9 +85,14 @@ NetBSD audio support.
+ goto fail;
+ }
+
++ if (ioctl(p->fd, AUDIO_GETFORMAT, &hw_info) == -1) {
++ MP_ERR(ao, "AUDIO_GETFORMAT failed: %s\n", mp_strerror(errno));
++ goto fail;
++ }
++
+ info.mode = AUMODE_PLAY;
+
-+ for (int n = 1; n <= NETBSD_MAX_CHANNELS; n++) {
++ for (int n = 1; n <= hw_info.play.channels; n++) {
+ struct mp_chmap map;
+
+ mp_chmap_from_channels(&map, n);
@@ -102,7 +105,7 @@ NetBSD audio support.
+ }
+
+ pinfo->channels = ao->channels.num;
-+ pinfo->sample_rate = ao->samplerate;
++ pinfo->sample_rate = ao->samplerate = hw_info.play.sample_rate;
+
+ switch (ao->format) {
+ case AF_FORMAT_U8:
@@ -124,14 +127,6 @@ NetBSD audio support.
+ MP_ERR(ao, "AUDIO_SETINFO failed: %s\n", mp_strerror(errno));
+ goto fail;
+ }
-+
-+ if (ioctl(p->fd, AUDIO_GETINFO, &info) == -1) {
-+ MP_ERR(ao, "AUDIO_GETINFO failed: %s\n", mp_strerror(errno));
-+ goto fail;
-+ }
-+
-+ ao->samplerate = pinfo->sample_rate;
-+
+ return 0;
+
+fail:
@@ -161,14 +156,31 @@ NetBSD audio support.
+ return;
+ }
+
++ (void)ioctl(p->fd, AUDIO_FLUSH, NULL);
++ (void)ioctl(p->fd, AUDIO_GETOOFFS, &offset); /* reset deltablks */
++ p->total_blocks = p->total_bytes / info.blocksize;
++}
++
++static void drain(struct ao *ao)
++{
++ struct priv *p = ao->priv;
++ struct audio_info info;
++ struct audio_offset offset;
++
++ if (ioctl(p->fd, AUDIO_GETINFO, &info) == -1) {
++ MP_ERR(ao, "AUDIO_GETINFO failed: %s\n", mp_strerror(errno));
++ return;
++ }
++
+ (void)ioctl(p->fd, AUDIO_DRAIN, NULL);
++ (void)ioctl(p->fd, AUDIO_FLUSH, NULL);
+ (void)ioctl(p->fd, AUDIO_GETOOFFS, &offset); /* reset deltablks */
+ p->total_blocks = p->total_bytes / info.blocksize;
+}
+
+static int get_space(struct ao *ao)
+{
-+ return NETBSD_BUF_FRAMES * ao->sstride;
++ return NETBSD_BUF_SIZE;
+}
+
+static void audio_pause(struct ao *ao)
@@ -260,6 +272,7 @@ NetBSD audio support.
+ .init = init,
+ .uninit = uninit,
+ .reset = reset,
++ .drain = drain,
+ .pause = audio_pause,
+ .resume = audio_resume,
+ .get_space = get_space,
Home |
Main Index |
Thread Index |
Old Index