This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit c97a2328c0a1b837efc60699d3760ed9a6153c21
Author:     Niklas Haas <[email protected]>
AuthorDate: Wed Jun 10 13:47:04 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Sun Jun 14 11:10:12 2026 +0200

    avformat/shared: set default cache timeout to 10 ms
    
    This value is matched to the typical seek latency in a reasonably capable
    7200 rpm disk device, as well as the typical latency of an on-premise HTTP
    request.
    
    Note that this change should rarely have a significant effect, because
    it only matters when using multiple concurrent processes, and one process
    is somehow stuck in I/O (or died). Since we sleep in a loop for 1/16th of
    the requested timeout value, this should only increase the effective read
    latency by up to ~500 us on top of the actual underlying latency.
    
    The alternative is hammering the same underlying resource with the exact
    same requests at the exact same time (e.g. during init).
    
    Sponsored-by: nxtedition AB
    Signed-off-by: Niklas Haas <[email protected]>
---
 doc/protocols.texi   | 2 +-
 libavformat/shared.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index a5ebd98a65..0ac28e78b5 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -1613,7 +1613,7 @@ and cache the same block at the same time. If this 
timeout elapses, it's
 assumed that the other process may have gotten stuck or died in the meantime.
 
 If set to zero, no waiting is done and all processes will immediately race
-to try and fetch the same missing blocks themselves. Defaults to 0.
+to try and fetch the same missing blocks themselves. Defaults to 10000 (10 ms).
 
 @item retry_errors
 If true (the default), transient read errors from the underlying input stream
diff --git a/libavformat/shared.c b/libavformat/shared.c
index 5ca3b718df..74000d76db 100644
--- a/libavformat/shared.c
+++ b/libavformat/shared.c
@@ -865,7 +865,7 @@ static const AVOption options[] = {
     { "block_shift",    "Set the base 2 logarithm of the block size",       
OFFSET(block_shift),    AV_OPT_TYPE_INT, {.i64 = 15}, 9, 30, .flags = D },
     { "read_only",      "Don't write data to the cache, only read from it", 
OFFSET(read_only),      AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, .flags = D },
     { "cache_verify",   "Verify correctness of the cache against the source",  
 OFFSET(verify),     AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, .flags = D },
-    { "cache_timeout",  "Time in us to wait before re-fetching pending 
blocks", OFFSET(timeout),    AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, 
.flags = D },
+    { "cache_timeout",  "Time in us to wait before re-fetching pending 
blocks", OFFSET(timeout),    AV_OPT_TYPE_INT64, {.i64 = 10000}, 0, INT64_MAX, 
.flags = D },
     { "retry_errors",   "Re-request blocks even if they previously failed", 
OFFSET(retry_errors),   AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, .flags = D },
     {0},
 };

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to