summaryrefslogtreecommitdiff
path: root/libavformat/rtmpproto.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r--libavformat/rtmpproto.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 979c5b6562..f47733814e 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -784,7 +784,6 @@ static int rtmp_close(URLContext *h)
av_freep(&rt->flv_data);
ffurl_close(rt->stream);
- av_free(rt);
return 0;
}
@@ -799,16 +798,12 @@ static int rtmp_close(URLContext *h)
*/
static int rtmp_open(URLContext *s, const char *uri, int flags)
{
- RTMPContext *rt;
+ RTMPContext *rt = s->priv_data;
char proto[8], hostname[256], path[1024], *fname;
uint8_t buf[2048];
int port;
int ret;
- rt = av_mallocz(sizeof(RTMPContext));
- if (!rt)
- return AVERROR(ENOMEM);
- s->priv_data = rt;
rt->is_input = !(flags & AVIO_FLAG_WRITE);
av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), &port,
@@ -1002,4 +997,5 @@ URLProtocol ff_rtmp_protocol = {
.url_read = rtmp_read,
.url_write = rtmp_write,
.url_close = rtmp_close,
+ .priv_data_size = sizeof(RTMPContext),
};