Skip to content

stream_curl: add support for Icecast metadata#17907

Open
kasper93 wants to merge 17 commits into
mpv-player:masterfrom
kasper93:icy-meta
Open

stream_curl: add support for Icecast metadata#17907
kasper93 wants to merge 17 commits into
mpv-player:masterfrom
kasper93:icy-meta

Conversation

@kasper93
Copy link
Copy Markdown
Member

No description provided.

kasper93 and others added 17 commits May 11, 2026 22:40
stream-lavf-o[cookies] only feeds the lavf stream backend. Instead of
side-loading it, use core `--cookies-file` option.
Introduces stream_http, an internal libcurl-driven backend for http://
and https:// URLs. Runs all transfers on a dedicated curl multi thread
with a producer-side ring buffer, and exposes HTTP/2 multiplexing,
QUIC/HTTP/3 (when libcurl supports it), HSTS and TCP keep-alive.

Should generally be more stable and faster than FFmpeg HTTP/1.1 impl,
additionally connections are kept-alive between files open, so if you
open playlist of network files and navigate through them, it will re-use
the same connection.

Build is gated on the new 'libcurl' meson option (auto). When disabled
or unavailable, mpv silently falls back to FFmpeg's HTTP implementation.
Hook AVFormatContext.io_open so HLS/DASH segment fetches and other
nested FFmpeg I/O go through stream_http when libcurl is available.
This lets segments inherit the connection reuse, HTTP/2 multiplexing,
mid-stream resume and conditional compression of the top-level stream.

Falls back to FFmpeg's default I/O for non-HTTP URLs and when the curl
backend is not built in.
Allow only subset of supported protocols by libcurl.
At the initial file open, the buffer may be populated with more data,
than later requested by decoder, but don't drop this data. This fixes
initial open to perform multiple reads of the area, especially for
images that are likelly fully read for probbing already.
It's significantly more stable than Lavf. Fixes seeking out of cached
ranges. Additionally correctly marks demuxer_is_network for ftp too.
@kasper93
Copy link
Copy Markdown
Member Author

kasper93 commented May 11, 2026

This is extracting the metadata in similar way to http.c in lavf. However, I'm not certain if the in-line metadata, shouldn't be handled by the demuxer itself, to updated them as they are playing in current time, not as they arrive at transport level. Though, it was like that in lavf forever.

Just for context, there are two kinds of information, in http header response, that mostly describe the stream and in data payload, interleaved with audio stream. Currently both are handled at transport level, but I doubt it's correct...

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.

2 participants