X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fmmsh.c;h=5e9d0bc1345eb07274ce5afb200487fe07aaf00b;hb=2bb2c2bd75e5f4b28a945511cda77e0a1a44c758;hp=3761016f8182687410dfec4343e6f247ad1d8d0b;hpb=9c6777bd9367e8680bb7ada9852f5760dc8a8594;p=ffmpeg diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c index 3761016f818..5e9d0bc1345 100644 --- a/libavformat/mmsh.c +++ b/libavformat/mmsh.c @@ -68,7 +68,6 @@ static int mmsh_close(URLContext *h) ffurl_close(mms->mms_hd); av_free(mms->streams); av_free(mms->asf_header); - av_freep(&h->priv_data); return 0; } @@ -217,12 +216,9 @@ static int mmsh_open(URLContext *h, const char *uri, int flags) char httpname[256], path[256], host[128], location[1024]; char *stream_selection = NULL; char headers[1024]; - MMSHContext *mmsh; + MMSHContext *mmsh = h->priv_data; MMSContext *mms; - mmsh = h->priv_data = av_mallocz(sizeof(MMSHContext)); - if (!h->priv_data) - return AVERROR(ENOMEM); mmsh->request_seq = h->is_streamed = 1; mms = &mmsh->mms; av_strlcpy(location, uri, sizeof(location)); @@ -363,8 +359,10 @@ static int mmsh_read(URLContext *h, uint8_t *buf, int size) } URLProtocol ff_mmsh_protocol = { - .name = "mmsh", - .url_open = mmsh_open, - .url_read = mmsh_read, - .url_close = mmsh_close, + .name = "mmsh", + .url_open = mmsh_open, + .url_read = mmsh_read, + .url_close = mmsh_close, + .priv_data_size = sizeof(MMSHContext), + .flags = URL_PROTOCOL_FLAG_NETWORK, };