<div dir="ltr"><div dir="ltr">STREAM_CAN_FASTSEEK was hardcoded to false regardless of the<br>underlying source. For local files opened via libavformat, random<br>access is O(1) and fast seek should be advertised correctly — VLC<br>uses this flag to decide whether to attempt seek-ahead buffering<br>optimisations.<br><br>The fix ties STREAM_CAN_FASTSEEK to two conditions: libavformat<br>reports the context as seekable, and the access scheme is "file".<br>Network schemes like http or rtsp can seek but not cheaply, so they<br>correctly continue to return false.<br><br>STREAM_CAN_SEEK is unchanged — it already reads sys->context->seekable<br>directly and covers the general case.<div><br></div><div>--- a/modules/access/avio.c<br>+++ b/modules/access/avio.c<br>@@ -322,7 +322,8 @@ static int Control(stream_t *access, int query, va_list args)<br> case STREAM_CAN_FASTSEEK:<br> b = va_arg(args, bool *);<br>- *b = false;<br>+ *b = sys->context->seekable &&<br>+ !strcmp(access->psz_name, "file");<br> return VLC_SUCCESS;</div></div>
</div>