summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Porter <adam@alphapapa.net>2026-01-05 22:33:13 -0600
committerAdam Porter <adam@alphapapa.net>2026-01-05 22:33:13 -0600
commitb22e7659279f8c1a60b7b8cd4c64d163674b43a1 (patch)
treea1865b512400e8cb9c6475057a6a8176fb982367
parente0a243d3c6ba0a8a14d1d16168ac23441bd5e6c9 (diff)
parent2a867549dc1fe6aaee9140cfa1f913fa5a74a3bf (diff)
Merge: v0.10.1externals/listen
-rw-r--r--README.org7
-rw-r--r--docs/README.org8
-rw-r--r--listen-info.el14
-rwxr-xr-xlisten-mpv.el6
-rwxr-xr-xlisten.el2
5 files changed, 28 insertions, 9 deletions
diff --git a/README.org b/README.org
index 80be667..5e87e12 100644
--- a/README.org
+++ b/README.org
@@ -198,6 +198,13 @@ The ~listen-mode~ minor mode runs a timer which plays the next track in the curr
- Similarly, you might even see an icon in your task switcher indicating that Emacs is playing sound (e.g. with KDE Plasma).
* Changelog
+** v0.10.1
+
+*Fixes*
+- Race condition in MPV support. (Fixes [[https://github.com/alphapapa/listen.el/issues/40][#40]]. Thanks to [[https://github.com/SemyonSinchenko][Semyon Sinchenko]] and [[https://github.com/Sjmarf][Sjmarf]] for reporting.)
+
+*Compatibility*
+- Accept Vorbis comments up to 16 MB in size. (See [[https://github.com/alphapapa/listen.el/pull/34][#34]]. Thanks to [[https://github.com/Etenil][@Etenil]] for reporting, and [[https://github.com/MinallW][Miguel Ángel Suárez Calles]] for testing.)
** v0.10
*Additions*
diff --git a/docs/README.org b/docs/README.org
index fe87a3b..2685fcc 100644
--- a/docs/README.org
+++ b/docs/README.org
@@ -235,6 +235,14 @@ The ~listen-mode~ minor mode runs a timer which plays the next track in the curr
* Changelog
+** v0.10.1
+
+*Fixes*
++ Race condition in MPV support. (Fixes [[https://github.com/alphapapa/listen.el/issues/40][#40]]. Thanks to [[https://github.com/SemyonSinchenko][Semyon Sinchenko]] and [[https://github.com/Sjmarf][Sjmarf]] for reporting.)
+
+*Compatibility*
++ Accept Vorbis comments up to 16 MB in size. (See [[https://github.com/alphapapa/listen.el/pull/34][#34]]. Thanks to [[https://github.com/Etenil][@Etenil]] for reporting, and [[https://github.com/MinallW][Miguel Ángel Suárez Calles]] for testing.)
+
** v0.10
*Additions*
diff --git a/listen-info.el b/listen-info.el
index 1d78d10..b342b0d 100644
--- a/listen-info.el
+++ b/listen-info.el
@@ -92,14 +92,14 @@ exhaustion in case of garbled or malicious inputs.
This limit is used with Opus and FLAC streams as well, since
their comments have almost the same format as Vorbis.")
-(defconst listen-info--max-vorbis-comment-size (* 64 1024)
+(defconst listen-info--max-vorbis-comment-size (* 16 1024 1024)
"Maximum length for a single Vorbis comment field.
-Technically a single Vorbis comment may have a length up to 2^32
-bytes, but in practice processing must be constrained to prevent
-memory exhaustion in case of garbled or malicious inputs.
-
-This limit is used with Opus and FLAC streams as well, since
-their comments have almost the same format as Vorbis.")
+Technically a single Vorbis comment may have a length up to 2^32 bytes,
+but it doesn't seem wise to accept 4 GB in this field, which could
+easily exhaust memory. Some tag editors may use more than 16 kB in this
+field (e.g. base64-encoded images), so we will allow 16 MB by default.
+Users who need comments larger than that should probably edit this value
+in their config.")
(defconst listen-info--max-vorbis-vendor-length 1024
"Maximum length of Vorbis vendor string.
diff --git a/listen-mpv.el b/listen-mpv.el
index 7f8218d..798efd3 100755
--- a/listen-mpv.el
+++ b/listen-mpv.el
@@ -230,7 +230,11 @@ Stops playing, clears playlist, adds FILE, and plays it."
(setf (map-elt (listen-player-etc player) :elapsed)
(+ (time-to-seconds
(time-subtract (current-time) (listen-player-playback-started-at player)))
- (listen-player-playback-started-from player)))
+ (or (listen-player-playback-started-from player)
+ ;; Avoid race condition: the playback-started-from slot is nil, so assume it
+ ;; should be 0 but hasn't been set yet (if it turns out to be incorrect, it will
+ ;; only cause the value returned by this function to be briefly incorrect).
+ 0)))
(map-elt (listen-player-etc player) :elapsed)))
(cl-defmethod listen--length ((player listen-player-mpv))
diff --git a/listen.el b/listen.el
index be7a653..925084b 100755
--- a/listen.el
+++ b/listen.el
@@ -6,7 +6,7 @@
;; Maintainer: Adam Porter <adam@alphapapa.net>
;; Keywords: multimedia
;; Package-Requires: ((emacs "29.1") (persist "0.6") (taxy "0.10") (taxy-magit-section "0.13") (transient "0.5.3"))
-;; Version: 0.10
+;; Version: 0.10.1
;; URL: https://github.com/alphapapa/listen.el
;; This program is free software; you can redistribute it and/or modify