From ffa9aaa2e458dcac3658a16c4d1fb14755de0ebd Mon Sep 17 00:00:00 2001 From: Mohammad AlSaleh Date: Mon, 17 Aug 2020 00:46:13 +0300 Subject: stream: Implement slice:// for reading slices of streams Add support for reading a byte range from a stream via the `slice://` protocol. Syntax is `slice://start[-end]@URL` where end is a maximum (read until end or eof). Size suffixes support in `m_option` is reused so they can be used with start/end. This can be very useful with e.g. large MPEGTS streams with corruption or time-stamp jumps or other issues in them. Signed-off-by: Mohammad AlSaleh --- stream/stream.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'stream/stream.c') diff --git a/stream/stream.c b/stream/stream.c index 3c728eacac..f422c5d08d 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -51,6 +51,7 @@ extern const stream_info_t stream_info_ffmpeg; extern const stream_info_t stream_info_ffmpeg_unsafe; extern const stream_info_t stream_info_avdevice; extern const stream_info_t stream_info_file; +extern const stream_info_t stream_info_slice; extern const stream_info_t stream_info_fd; extern const stream_info_t stream_info_ifo_dvdnav; extern const stream_info_t stream_info_dvdnav; @@ -88,6 +89,7 @@ static const stream_info_t *const stream_list[] = { &stream_info_mf, &stream_info_edl, &stream_info_file, + &stream_info_slice, &stream_info_fd, &stream_info_cb, NULL -- cgit v1.2.3