Mercurial > libavformat.hg
comparison avio.c @ 6392:daca8bebdd88 libavformat
add FF_API_URL_CLASS define to enable usage of URLContext as a AVClass
author | aurel |
---|---|
date | Thu, 19 Aug 2010 16:49:08 +0000 |
parents | 1c656ac8c9c9 |
children | 896acb967d32 |
comparison
equal
deleted
inserted
replaced
6391:d05e8fb04c6f | 6392:daca8bebdd88 |
---|---|
28 #include "avformat.h" | 28 #include "avformat.h" |
29 #if CONFIG_NETWORK | 29 #if CONFIG_NETWORK |
30 #include "network.h" | 30 #include "network.h" |
31 #endif | 31 #endif |
32 | 32 |
33 #if LIBAVFORMAT_VERSION_MAJOR >= 53 | 33 #if FF_API_URL_CLASS |
34 /** @name Logging context. */ | 34 /** @name Logging context. */ |
35 /*@{*/ | 35 /*@{*/ |
36 static const char *urlcontext_to_name(void *ptr) | 36 static const char *urlcontext_to_name(void *ptr) |
37 { | 37 { |
38 URLContext *h = (URLContext *)ptr; | 38 URLContext *h = (URLContext *)ptr; |
107 uc = av_mallocz(sizeof(URLContext) + strlen(filename) + 1); | 107 uc = av_mallocz(sizeof(URLContext) + strlen(filename) + 1); |
108 if (!uc) { | 108 if (!uc) { |
109 err = AVERROR(ENOMEM); | 109 err = AVERROR(ENOMEM); |
110 goto fail; | 110 goto fail; |
111 } | 111 } |
112 #if LIBAVFORMAT_VERSION_MAJOR >= 53 | 112 #if FF_API_URL_CLASS |
113 uc->av_class = &urlcontext_class; | 113 uc->av_class = &urlcontext_class; |
114 #endif | 114 #endif |
115 uc->filename = (char *) &uc[1]; | 115 uc->filename = (char *) &uc[1]; |
116 strcpy(uc->filename, filename); | 116 strcpy(uc->filename, filename); |
117 uc->prot = up; | 117 uc->prot = up; |