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

Git pushed a commit to branch master
in repository ffmpeg.

commit ae1f4df8a4a8010d54a6dfca6a99d366f23b026a
Author:     Niklas Haas <[email protected]>
AuthorDate: Thu Jul 9 16:23:43 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Thu Sep 3 19:05:28 2026 +0000

    avformat/libcurl: early-exit on_done() when aborted
    
    Simplifies this logic by not having to embed a check for !aborted
    in every conditional branch.
    
    Sponsored-by: nxtedition AB
    Signed-off-by: Niklas Haas <[email protected]>
---
 libavformat/libcurl.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/libavformat/libcurl.c b/libavformat/libcurl.c
index f50b71ed6f..334c33e432 100644
--- a/libavformat/libcurl.c
+++ b/libavformat/libcurl.c
@@ -481,7 +481,10 @@ static void on_done(CurlContext *c, CURLcode code)
         return;
     }
 
-    if (code == CURLE_OK && !aborted && c->stream_ok) {
+    if (aborted)
+        return;
+
+    if (code == CURLE_OK && c->stream_ok) {
         c->retry_count = 0;
         int64_t file_end = c->content_size > 0 ? c->content_size - 1 : -1;
         if (c->end_off > 0)
@@ -499,7 +502,7 @@ static void on_done(CurlContext *c, CURLcode code)
     }
 
     /* Resume seekable transfers after a recoverable error. */
-    if (!aborted && c->seekable && is_recoverable(code) &&
+    if (c->seekable && is_recoverable(code) &&
         c->retry_count < c->max_retries) {
         c->retry_count++;
         c->loop->num_retries++;
@@ -509,13 +512,12 @@ static void on_done(CurlContext *c, CURLcode code)
         return;
     }
 
-    if (!aborted) {
-        pthread_mutex_lock(&c->mutex);
-        if (!c->status)
-            c->status = curlcode_to_averror(code);
-        pthread_cond_broadcast(&c->cond);
-        pthread_mutex_unlock(&c->mutex);
-    }
+    /* Unhandled generic curl error */
+    pthread_mutex_lock(&c->mutex);
+    if (!c->status)
+        c->status = curlcode_to_averror(code);
+    pthread_cond_broadcast(&c->cond);
+    pthread_mutex_unlock(&c->mutex);
 }
 
 /* ------------------------------------------------------------------------- */

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to