Sunday, January 26, 2025

Re: x11/vlc: Fix the volume hot-keys

On 2025-01-21 7:19 a.m., Alexandre Ratchov wrote:
Sometimes the audio increase/decrease volume command are stuck to a  fixed value. This diff fixes this problem.    The hot-keys for above commands are the volume keys of multimedia  keyboards. These keys are already used by the OpenBSD kernel for other  volume adjustments; probably, that's why this problem stayed  unnoticed.    OK?

I can't test this. But I guess it's Ok.

Also what about the comment just below this in Open().

/* FIXME: set volume/mute here */

Does anything else need to be done there or should the comment
simply be removed?

  Index: Makefile  ===================================================================  RCS file: /cvs/ports/x11/vlc/Makefile,v  retrieving revision 1.278  diff -u -p -r1.278 Makefile  --- Makefile	17 Nov 2024 15:02:05 -0000	1.278  +++ Makefile	21 Jan 2025 12:05:05 -0000  @@ -9,7 +9,7 @@ CATEGORIES=	x11   SITES=		https://download.videolan.org/pub/videolan/vlc/${V}/   EXTRACT_SUFX=	.tar.xz   REVISION-jack=	0  -REVISION-main=	0  +REVISION-main=	1      USE_NOBTCFI=	Yes     Index: patches/patch-modules_audio_output_sndio_c  ===================================================================  RCS file: /cvs/ports/x11/vlc/patches/patch-modules_audio_output_sndio_c,v  retrieving revision 1.6  diff -u -p -r1.6 patch-modules_audio_output_sndio_c  --- patches/patch-modules_audio_output_sndio_c	1 Aug 2024 11:28:01 -0000	1.6  +++ patches/patch-modules_audio_output_sndio_c	21 Jan 2025 12:05:05 -0000  @@ -1,5 +1,6 @@   Use sio_flush() instead of sio_stop() to improve controls responsiveness.     +Report the the actual volume, fixes volume increment/decrement.   Index: modules/audio_output/sndio.c   --- modules/audio_output/sndio.c.orig   +++ modules/audio_output/sndio.c  @@ -12,3 +13,20 @@ Index: modules/audio_output/sndio.c        sys->started = 0;        sys->delay = 0;        sio_start (sys->hdl);  +@@ -276,6 +276,8 @@ static int VolumeSet (audio_output_t *aout, float fvol  +     if (!sys->mute && !sio_setvol (sys->hdl, volume))  +         return -1;  +     sys->volume = volume;  ++    aout_VolumeReport (aout, (float)sys->volume / SIO_MAXVOL);  ++    aout_MuteReport (aout, sys->volume == 0);  +     return 0;  + }  +   +@@ -287,6 +289,7 @@ static int MuteSet (audio_output_t *aout, bool mute)  +         return -1;  +   +     sys->mute = mute;  ++    aout_MuteReport (aout, mute);  +     return 0;  + }  +     

No comments:

Post a Comment