Replies: 1 comment
-
|
Hmmm it seems nobody cares.... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I wrote a Python wrapper around mpv that drives it through JSON IPC. The flow is simple — I call:
so there is always one item queued ahead of the currently playing one.
I have two related problems:
Preload doesn't handle HTTP error status codes.
If the playlist items are URLs and the server returns e.g. 403, mpv silently keeps the entry in the playlist as if everything is fine. The failure only surfaces later, when mpv switches to that entry and tries to actually demux it — at which point playback stalls/freezes. To work around this I added a Python-side preload check: before sending loadfile, I do an HTTP HEAD request, and if it fails I skip that item and send the next one to mpv instead.
I can't correlate end-file events with my own playlist.
I have an event listener that catches end-file (with reason, file_error, etc.), but I can't tell which item from my Python playlist actually ended. I know mpv provides playlist_entry_id in both the loadfile response and the end-file event, but that's an internal mpv ID — not my own index, and not stable across the skips described in problem 1 (where my Python index and mpv's playlist drift apart).
What I would expect is the ability to attach arbitrary metadata to a playlist entry when calling loadfile, something like:
and then receive that same <my_custom_id> back inside every event that concerns this entry (start-file, end-file, etc.). That would let me pair events with my Python playlist directly, without having to maintain a separate playlist_entry_id ↔ my-index mapping (which is fragile when entries are skipped or replaced).
Is there already a way to do this that I'm missing? If not, would such a feature (user-defined per-entry metadata exposed in events) be something the mpv team would consider?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions