git: f05f058867c8 - main - audio/alsa-utils: aplaymidi doesn't play at the proper tempo

From: Rodrigo Osorio <rodrigo_at_FreeBSD.org>
Date: Wed, 29 Nov 2023 21:07:28 UTC
The branch main has been updated by rodrigo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f05f058867c8cba577ff6c6f90631e9940e947db

commit f05f058867c8cba577ff6c6f90631e9940e947db
Author:     Rodrigo Osorio <rodrigo@FreeBSD.org>
AuthorDate: 2023-11-29 20:44:12 +0000
Commit:     Rodrigo Osorio <rodrigo@FreeBSD.org>
CommitDate: 2023-11-29 21:07:13 +0000

    audio/alsa-utils: aplaymidi doesn't play at the proper tempo
    
    Add temporary patch to fix an issue with tempo events
    
    aplaymidi does not process tempo events because the part
    that handles tempo events was not rewritten sufficiently.
    It may be executed as a different event in songs that
    have tempo changes in the middle of the song.
    
    A similar fix was submitted to upstream as
    https://github.com/alsa-project/alsa-utils/issues/241
    
    PR:             275349
    Reported by:    Tatsuki Makino <tatsuki_makino@hotmail.com>
---
 audio/alsa-utils/Makefile                              |  1 +
 audio/alsa-utils/files/patch-seq_aplaymidi_aplaymidi.c | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/audio/alsa-utils/Makefile b/audio/alsa-utils/Makefile
index 16ea4c0b46ba..b4498f4cad3f 100644
--- a/audio/alsa-utils/Makefile
+++ b/audio/alsa-utils/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	alsa-utils
 PORTVERSION=	1.2.10
+PORTREVISION=	1
 CATEGORIES=	audio
 MASTER_SITES=	https://www.alsa-project.org/files/pub/utils/
 
diff --git a/audio/alsa-utils/files/patch-seq_aplaymidi_aplaymidi.c b/audio/alsa-utils/files/patch-seq_aplaymidi_aplaymidi.c
new file mode 100644
index 000000000000..03c821703455
--- /dev/null
+++ b/audio/alsa-utils/files/patch-seq_aplaymidi_aplaymidi.c
@@ -0,0 +1,11 @@
+--- seq/aplaymidi/aplaymidi.c.orig	2023-09-01 15:36:26 UTC
++++ seq/aplaymidi/aplaymidi.c
+@@ -819,6 +819,8 @@ static void play_midi(void)
+ 		ev.time.tick = event->tick;
+ 		ev.dest = ports[event->port];
+ 		if (event->type == SND_SEQ_EVENT_TEMPO) {
++			snd_seq_ev_set_fixed(&ev);
++			ev.type = event->type;
+ 			ev.dest.client = SND_SEQ_CLIENT_SYSTEM;
+ 			ev.dest.port = SND_SEQ_PORT_SYSTEM_TIMER;
+ 			ev.data.queue.queue = queue;