This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 835ebef5351dd7bd60ce59070c24099678c93021 Author: Niklas Haas <[email protected]> AuthorDate: Wed Jun 24 14:12:37 2026 +0200 Commit: Kacper Michajłow <[email protected]> CommitDate: Mon Jul 27 17:05:20 2026 +0000 avformat/libcurl: keep track of owning AVFormatContext For avfc-attached curl loops. Sponsored-by: nxtedition AB Signed-off-by: Niklas Haas <[email protected]> --- libavformat/libcurl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavformat/libcurl.c b/libavformat/libcurl.c index 44054d16df..7189ae90b6 100644 --- a/libavformat/libcurl.c +++ b/libavformat/libcurl.c @@ -70,6 +70,8 @@ typedef struct CurlCmd { } CurlCmd; typedef struct CurlLoop { + AVFormatContext *avfc; /* owning context (if any) */ + pthread_t thread; CURLM *multi; CURLSH *share; /* shared cookies/DNS/TLS sessions/HSTS */ @@ -548,11 +550,12 @@ static int curl_dispatch(CurlLoop *loop, enum cmd_kind kind, CurlContext *c, return 0; } -static CurlLoop *curl_loop_create(void) +static CurlLoop *curl_loop_create(AVFormatContext *avfc) { CurlLoop *loop = av_mallocz(sizeof(*loop)); if (!loop) return NULL; + loop->avfc = avfc; if (pthread_mutex_init(&loop->mutex, NULL)) goto fail; @@ -618,7 +621,7 @@ static void curl_loop_destroy(CurlLoop *loop) static int curl_loop_attach(CurlContext *c, AVFormatContext *avfc) { if (!avfc) { - c->loop = curl_loop_create(); + c->loop = curl_loop_create(NULL); c->private_loop = 1; return c->loop ? 0 : AVERROR(ENOMEM); } @@ -626,7 +629,7 @@ static int curl_loop_attach(CurlContext *c, AVFormatContext *avfc) pthread_mutex_lock(&curl_loop_lock); c->loop = ffformatcontext(avfc)->curl_loop; if (!c->loop) { - c->loop = curl_loop_create(); + c->loop = curl_loop_create(avfc); ffformatcontext(avfc)->curl_loop = c->loop; } pthread_mutex_unlock(&curl_loop_lock); _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
