Skip to content

Fix org-mode mpv link timestamp parameter passing#26

Open
iT-Boyer wants to merge 2 commits into
lorniu:masterfrom
iT-Boyer:fix/org-link-timestamp
Open

Fix org-mode mpv link timestamp parameter passing#26
iT-Boyer wants to merge 2 commits into
lorniu:masterfrom
iT-Boyer:fix/org-link-timestamp

Conversation

@iT-Boyer

Copy link
Copy Markdown

问题

在 org-mode 中使用带时间戳的 mpv 链接时(例如 [[mpv:https://www.youtube.com/watch?v=wNH2E7iT__c#233.316667][▶ 03:53]]),预期应该从指定时间(233 秒)开始播放,但实际视频总是从头开始播放。

根本原因

mpvi-org-link-push 函数中调用 mpvi-start 时,参数传递顺序错误:

;; 错误的调用
(mpvi-start path beg end)

mpvi-start 的函数签名是:

(defun mpvi-start (path &optional type beg end)

这导致参数错位:

  • beg (233.316667) 被传递给了 type
  • end (nil) 被传递给了 beg,然后被设置为 0
  • 最终视频从 0 秒开始播放

修复方案

  1. mpvi-org-link-push 中添加 nil 作为 type 参数
  2. join-opts 中将 %S 改为 %s,避免给数值类型加引号

Fixes #25

- Add nil as type parameter in mpvi-org-link-push to fix parameter order
- Change %S to %s in join-opts to avoid adding quotes to numeric values
- This fixes the issue where videos always play from start instead of the specified timestamp

Fixes lorniu#25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

org-mode mpv: 链接中的时间戳参数被错误传递,导致视频从头播放

1 participant