[vlc-devel] [PATCH] access/avio: report FASTSEEK capability based on scheme and seekability
Felix Paul Kühne
fkuehne at videolan.org
Mon Apr 20 06:33:23 UTC 2026
Hello,
Please open a merge request. Contributions by patch through the mailing-list are no longer accepted.
Best regards,
Felix
> On 20. Apr 2026, at 00:15, Namit Chugh <nchugh1208 at gmail.com> wrote:
>
> 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;
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list