@@ -92,6 +92,22 @@ struct curl_opts {
9292#define CURL_HTTP_VERSION_3ONLY CURL_HTTP_VERSION_NONE
9393#endif
9494
95+ // Older lavf has a bug with nested IO cleanup, so don't enable curl by default.
96+ // <https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23082>
97+ #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT (62 , 15 , 101 )
98+ #define CURL_BY_DEFAULT
99+ #elif LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT (62 , 12 , 102 ) && LIBAVFORMAT_VERSION_INT < AV_VERSION_INT (62 , 13 , 0 )
100+ #define CURL_BY_DEFAULT /* 8.1 backport */
101+ #elif LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT (62 , 3 , 103 ) && LIBAVFORMAT_VERSION_INT < AV_VERSION_INT (62 , 4 , 0 )
102+ #define CURL_BY_DEFAULT /* 8.0 backport */
103+ #elif LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT (61 , 7 , 103 ) && LIBAVFORMAT_VERSION_INT < AV_VERSION_INT (61 , 8 , 0 )
104+ #define CURL_BY_DEFAULT /* 7.1 backport */
105+ #elif LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT (61 , 1 , 103 ) && LIBAVFORMAT_VERSION_INT < AV_VERSION_INT (61 , 2 , 0 )
106+ #define CURL_BY_DEFAULT /* 7.0 backport */
107+ #elif LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT (60 , 16 , 101 ) && LIBAVFORMAT_VERSION_INT < AV_VERSION_INT (60 , 17 , 0 )
108+ #define CURL_BY_DEFAULT /* 6.1 backport */
109+ #endif
110+
95111#define OPT_BASE_STRUCT struct curl_opts
96112const struct m_sub_options curl_conf = {
97113 .opts = (const struct m_option []) {
@@ -116,9 +132,9 @@ const struct m_sub_options curl_conf = {
116132 {0 }
117133 },
118134 .defaults = & (const struct curl_opts ) {
119- // Older lavf has a bug with nested IO cleanup, disable by default.
120- // <https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23082>
121- . enabled = LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT ( 62 , 15 , 101 ),
135+ #ifdef CURL_BY_DEFAULT
136+ . enabled = true,
137+ #endif
122138 .http_version = CURL_HTTP_VERSION_NONE ,
123139 .max_redirects = 16 ,
124140 .max_retries = 5 ,
0 commit comments