[vlc-devel] [PATCH] access/avio: report FASTSEEK capability based on scheme and seekability
Namit Chugh
nchugh1208 at gmail.com
Sun Apr 19 22:15:43 UTC 2026
STREAM_CAN_FASTSEEK was hardcoded to false regardless of the
underlying source. For local files opened via libavformat, random
access is O(1) and fast seek should be advertised correctly — VLC
uses this flag to decide whether to attempt seek-ahead buffering
optimisations.
The fix ties STREAM_CAN_FASTSEEK to two conditions: libavformat
reports the context as seekable, and the access scheme is "file".
Network schemes like http or rtsp can seek but not cheaply, so they
correctly continue to return false.
STREAM_CAN_SEEK is unchanged — it already reads sys->context->seekable
directly and covers the general case.
--- a/modules/access/avio.c
+++ b/modules/access/avio.c
@@ -322,7 +322,8 @@ static int Control(stream_t *access, int query, va_list
args)
case STREAM_CAN_FASTSEEK:
b = va_arg(args, bool *);
- *b = false;
+ *b = sys->context->seekable &&
+ !strcmp(access->psz_name, "file");
return VLC_SUCCESS;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20260420/38d0793e/attachment.htm>
More information about the vlc-devel
mailing list