Browse code

lavf: use designated initializers for AVClasses.

Anton Khirnov authored on 2011/04/29 18:30:02
Showing 7 changed files
... ...
@@ -39,8 +39,12 @@ static const char *urlcontext_to_name(void *ptr)
39 39
     else        return "NULL";
40 40
 }
41 41
 static const AVOption options[] = {{NULL}};
42
-static const AVClass urlcontext_class =
43
-        { "URLContext", urlcontext_to_name, options, LIBAVUTIL_VERSION_INT };
42
+static const AVClass urlcontext_class = {
43
+    .class_name     = "URLContext",
44
+    .item_name      = urlcontext_to_name,
45
+    .option         = options,
46
+    .version        = LIBAVUTIL_VERSION_INT,
47
+};
44 48
 /*@}*/
45 49
 
46 50
 static int default_interrupt_cb(void);
... ...
@@ -52,7 +52,10 @@ static const AVOption options[] = {
52 52
 };
53 53
 
54 54
 static const AVClass crypto_class = {
55
-    "crypto", av_default_item_name, options, LIBAVUTIL_VERSION_INT
55
+    .class_name     = "crypto",
56
+    .item_name      = av_default_item_name,
57
+    .option         = options,
58
+    .version        = LIBAVUTIL_VERSION_INT,
56 59
 };
57 60
 
58 61
 static int crypto_open(URLContext *h, const char *uri, int flags)
... ...
@@ -58,7 +58,10 @@ static const AVOption options[] = {
58 58
 {NULL}
59 59
 };
60 60
 static const AVClass httpcontext_class = {
61
-    "HTTP", av_default_item_name, options, LIBAVUTIL_VERSION_INT
61
+    .class_name     = "HTTP",
62
+    .item_name      = av_default_item_name,
63
+    .option         = options,
64
+    .version        = LIBAVUTIL_VERSION_INT,
62 65
 };
63 66
 
64 67
 static int http_connect(URLContext *h, const char *path, const char *hoststr,
... ...
@@ -167,10 +167,10 @@ static const AVOption options[] = {
167 167
 };
168 168
 
169 169
 static const AVClass mp3_muxer_class = {
170
-    "MP3 muxer",
171
-    av_default_item_name,
172
-    options,
173
-    LIBAVUTIL_VERSION_INT,
170
+    .class_name     = "MP3 muxer",
171
+    .item_name      = av_default_item_name,
172
+    .option         = options,
173
+    .version        = LIBAVUTIL_VERSION_INT,
174 174
 };
175 175
 
176 176
 static int id3v2_check_write_tag(AVFormatContext *s, AVMetadataTag *t, const char table[][4],
... ...
@@ -89,10 +89,10 @@ static const AVOption options[] = {
89 89
 };
90 90
 
91 91
 static const AVClass mpegts_muxer_class = {
92
-    "MPEGTS muxer",
93
-    av_default_item_name,
94
-    options,
95
-    LIBAVUTIL_VERSION_INT,
92
+    .class_name     = "MPEGTS muxer",
93
+    .item_name      = av_default_item_name,
94
+    .option         = options,
95
+    .version        = LIBAVUTIL_VERSION_INT,
96 96
 };
97 97
 
98 98
 /* NOTE: 4 bytes must be left at the end for the crc32 */
... ...
@@ -64,7 +64,12 @@ static const AVOption options[]={
64 64
 #undef D
65 65
 #undef DEFAULT
66 66
 
67
-static const AVClass av_format_context_class = { "AVFormatContext", format_to_name, options, LIBAVUTIL_VERSION_INT };
67
+static const AVClass av_format_context_class = {
68
+    .class_name     = "AVFormatContext",
69
+    .item_name      = format_to_name,
70
+    .option         = options,
71
+    .version        = LIBAVUTIL_VERSION_INT,
72
+};
68 73
 
69 74
 static void avformat_get_context_defaults(AVFormatContext *s)
70 75
 {
... ...
@@ -93,7 +93,12 @@ static const AVOption options[] = {
93 93
 { NULL },
94 94
 };
95 95
 
96
-static const AVClass class = { "spdif", av_default_item_name, options, LIBAVUTIL_VERSION_INT };
96
+static const AVClass class = {
97
+    .class_name     = "spdif",
98
+    .item_name      = av_default_item_name,
99
+    .option         = options,
100
+    .version        = LIBAVUTIL_VERSION_INT,
101
+};
97 102
 
98 103
 static int spdif_header_ac3(AVFormatContext *s, AVPacket *pkt)
99 104
 {