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

Git pushed a commit to branch master
in repository ffmpeg.

commit b737bddaf197be1cd6b846b4d8810fb20a2366d0
Author:     Niklas Haas <[email protected]>
AuthorDate: Tue Jun 23 17:37:54 2026 +0200
Commit:     Kacper Michajłow <[email protected]>
CommitDate: Mon Jul 27 17:05:20 2026 +0000

    avformat/avio: re-use av_opt_set() to parse prefer_libcurl
    
    Otherwise, this fails to parse values like "true" or "yes". This does
    require stack-allocating a dummy object, but that's not a big deal, as
    we only ever set this single option on it, so nothing should ever
    get allocated.
    
    Sponsored-by: nxtedition AB
    Signed-off-by: Niklas Haas <[email protected]>
---
 libavformat/avio.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index ccc98bab67..3e8f32d899 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -377,14 +377,19 @@ extern const URLProtocol ff_libcurl_protocol;
  * of the native one. Controlled by the per-open "prefer_libcurl" option. */
 static int prefer_libcurl(const char *filename, AVDictionary **options)
 {
+    URLContext dummy = { .av_class = &url_context_class };
     AVDictionaryEntry *e;
 
-    if (!options || !(e = av_dict_get(*options, "prefer_libcurl", NULL, 0)) ||
-        !atoi(e->value))
+    if (!av_strstart(filename, "http://";,  NULL) &&
+        !av_strstart(filename, "https://";, NULL))
         return 0;
 
-    return av_strstart(filename, "http://";,  NULL) ||
-           av_strstart(filename, "https://";, NULL);
+    if (!options || !(e = av_dict_get(*options, "prefer_libcurl", NULL, 0)))
+        return 0;
+    if (av_opt_set(&dummy, "prefer_libcurl", e->value, 0) < 0)
+        return 0;
+
+    return dummy.prefer_libcurl;
 }
 #endif
 

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

Reply via email to