diff --git a/emms-player-mpv.el b/emms-player-mpv.el index 4b7b908..1683380 100644 --- a/emms-player-mpv.el +++ b/emms-player-mpv.el @@ -651,19 +651,20 @@ errors, if any." Only used with JSON IPC, never called with --input-file as there's no feedback there." (emms-player-mpv-debug-msg "json << %s" json) - (let* - ((json-data (json-read-from-string json)) - (req-id (alist-get 'request_id json-data)) - (ev (alist-get 'event json-data))) - (when req-id - ;; Response to command - (emms-player-mpv-ipc-req-resolve req-id - (alist-get 'data json-data) - (alist-get 'error json-data))) - (when ev - ;; mpv event - (emms-player-mpv-event-handler json-data) - (run-hook-with-args 'emms-player-mpv-event-functions json-data)))) + (when (string-match "^{" json) + (let* + ((json-data (json-read-from-string json)) + (req-id (alist-get 'request_id json-data)) + (ev (alist-get 'event json-data))) + (when req-id + ;; Response to command + (emms-player-mpv-ipc-req-resolve req-id + (alist-get 'data json-data) + (alist-get 'error json-data))) + (when ev + ;; mpv event + (emms-player-mpv-event-handler json-data) + (run-hook-with-args 'emms-player-mpv-event-functions json-data))))) (defun emms-player-mpv-ipc-fifo-cmd (cmd &optional proc) "Send --input-file command string for older mpv versions.