diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-02 00:51:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-02 00:51:11 +0100 |
commit | 7b0b10ce4186eaa1cd3c0a2bfbb86307d65eecfd (patch) | |
tree | a9a937af698ca14ef06ec2c07453f474aa5ca3c7 /libavformat/rtmpproto.c | |
parent | 8b08f81949bcfa6fec42ff3f1c9bef5be8140300 (diff) | |
parent | 04403ec2e405a3cfcfbdd45f1274be30c652e462 (diff) | |
download | ffmpeg-7b0b10ce4186eaa1cd3c0a2bfbb86307d65eecfd.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (25 commits)
rtpenc: Add support for G726 audio
rtpdec: Interpret the different G726 names as bits_per_coded_sample
rtpenc: Change rtp_send_samples to handle sample sizes other than even bytes
rtpenc: Cast a rescaling parameter to int64_t
h264: cap max has_b_frames at MAX_DELAYED_PIC_COUNT - 1.
ARM: fix indentation in ff_dsputil_init_neon()
ARM: NEON put/avg_pixels8/16 cosmetics
ARM: add remaining NEON avg_pixels8/16 functions
ARM: clean up NEON put/avg_pixels macros
fate: split acodec-pcm into individual tests
swscale: #include "libavutil/mathematics.h"
pmpdec: don't use deprecated av_set_pts_info.
rv34: align temporary block of "dct" coefs
Add PlayStation Portable PMP format demuxer
proto: Realign struct initializers
proto: Use .priv_data_size to allocate the private context
mmsh: Properly clean up if the second ffurl_alloc failed
rtmp: Clean up properly if the handshake failed
md5proto: Remove the get_file_handle function
applehttpproto: Use the close function if the open function fails
...
Conflicts:
libavcodec/vble.c
libavformat/mmsh.c
libavformat/pmpdec.c
libavformat/udp.c
tests/ref/acodec/pcm
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r-- | libavformat/rtmpproto.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 8935f56369..8f57d1bb59 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, @@ -826,7 +821,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) rt->state = STATE_START; if (rtmp_handshake(s, rt)) - return -1; + goto fail; rt->chunk_size = 128; rt->state = STATE_HANDSHAKED; @@ -997,9 +992,10 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size) } URLProtocol ff_rtmp_protocol = { - .name = "rtmp", - .url_open = rtmp_open, - .url_read = rtmp_read, - .url_write = rtmp_write, - .url_close = rtmp_close, + .name = "rtmp", + .url_open = rtmp_open, + .url_read = rtmp_read, + .url_write = rtmp_write, + .url_close = rtmp_close, + .priv_data_size = sizeof(RTMPContext), }; |