diff options
author | Martin Storsjö <martin@martin.st> | 2010-06-22 14:09:08 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-06-22 14:09:08 +0000 |
commit | 735cf6b2657c48ffd9ba4eb66ae8a0a3419de074 (patch) | |
tree | 8b1bd2a99e32bd3f7c63112a8f7afea79eae57c2 /libavformat/avio.c | |
parent | 4636f115513d8dadf1a398e64e7889899e2c89ca (diff) | |
download | ffmpeg-streaming-735cf6b2657c48ffd9ba4eb66ae8a0a3419de074.zip ffmpeg-streaming-735cf6b2657c48ffd9ba4eb66ae8a0a3419de074.tar.gz |
Add priv_data_size and priv_data_class to URLProtocol
This allows url_alloc to allocate and initialize the priv_data.
Originally committed as revision 23706 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r-- | libavformat/avio.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c index 240289d..5d48ac0 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -118,6 +118,13 @@ static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up, uc->flags = flags; uc->is_streamed = 0; /* default = not streamed */ uc->max_packet_size = 0; /* default: stream file */ + if (up->priv_data_size) { + uc->priv_data = av_mallocz(up->priv_data_size); + if (up->priv_data_class) { + *(AVClass**)uc->priv_data = up->priv_data_class; + av_opt_set_defaults(uc->priv_data); + } + } *puc = uc; return 0; @@ -272,6 +279,8 @@ int url_close(URLContext *h) #if CONFIG_NETWORK ff_network_close(); #endif + if (h->prot->priv_data_size) + av_free(h->priv_data); av_free(h); return ret; } |