[FFmpeg-cvslog] http: use different classes for http and https.

Anton Khirnov git at videolan.org
Fri Nov 11 02:53:05 CET 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Nov  5 12:54:01 2011 +0100| [3b384502f2950dd8f172060bfa74447a665af6d9] | committer: Anton Khirnov

http: use different classes for http and https.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b384502f2950dd8f172060bfa74447a665af6d9
---

 libavformat/http.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 783ac6a..5c47f1d 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -57,13 +57,17 @@ static const AVOption options[] = {
 {"headers", "custom HTTP headers, can override built in default headers", OFFSET(headers), AV_OPT_TYPE_STRING },
 {NULL}
 };
-static const AVClass httpcontext_class = {
-    .class_name     = "HTTP",
-    .item_name      = av_default_item_name,
-    .option         = options,
-    .version        = LIBAVUTIL_VERSION_INT,
+#define HTTP_CLASS(flavor)\
+static const AVClass flavor ## _context_class = {\
+    .class_name     = #flavor,\
+    .item_name      = av_default_item_name,\
+    .option         = options,\
+    .version        = LIBAVUTIL_VERSION_INT,\
 };
 
+HTTP_CLASS(http);
+HTTP_CLASS(https);
+
 static int http_connect(URLContext *h, const char *path, const char *hoststr,
                         const char *auth, int *new_location);
 
@@ -518,7 +522,7 @@ URLProtocol ff_http_protocol = {
     .url_close           = http_close,
     .url_get_file_handle = http_get_file_handle,
     .priv_data_size      = sizeof(HTTPContext),
-    .priv_data_class     = &httpcontext_class,
+    .priv_data_class     = &http_context_class,
 };
 #endif
 #if CONFIG_HTTPS_PROTOCOL
@@ -531,6 +535,6 @@ URLProtocol ff_https_protocol = {
     .url_close           = http_close,
     .url_get_file_handle = http_get_file_handle,
     .priv_data_size      = sizeof(HTTPContext),
-    .priv_data_class     = &httpcontext_class,
+    .priv_data_class     = &https_context_class,
 };
 #endif



More information about the ffmpeg-cvslog mailing list