diff options
author | Stephan Soller <stephan.soller@helionweb.de> | 2014-04-13 01:06:22 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-04-14 14:28:22 +0200 |
commit | 36b9c27dae452e10b4fff3d10f836160a5b8fbbd (patch) | |
tree | 7b4f09c91b96c740dbb07b5b751682c6c64aae03 /libavformat/rtmpproto.c | |
parent | 8e5f84047268566a1420db4f10975ad93290515e (diff) | |
download | ffmpeg-36b9c27dae452e10b4fff3d10f836160a5b8fbbd.tar.gz |
avformat/rtmpproto: Added handling of an initial RTMP chunk size packet.
Fixes ticket #2911.
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r-- | libavformat/rtmpproto.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 0b39b98124..26c4d8e0bc 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -150,6 +150,8 @@ static const uint8_t rtmp_server_key[] = { 0xE6, 0x36, 0xCF, 0xEB, 0x31, 0xAE }; +static int handle_chunk_size(URLContext *s, RTMPPacket *pkt); + static int add_tracked_method(RTMPContext *rt, const char *name, int id) { int err; @@ -408,6 +410,17 @@ static int read_connect(URLContext *s, RTMPContext *rt) if ((ret = ff_rtmp_packet_read(rt->stream, &pkt, rt->in_chunk_size, &rt->prev_pkt[0], &rt->nb_prev_pkt[0])) < 0) return ret; + + if (pkt.type == RTMP_PT_CHUNK_SIZE) { + if ((ret = handle_chunk_size(s, &pkt)) < 0) + return ret; + + ff_rtmp_packet_destroy(&pkt); + if ((ret = ff_rtmp_packet_read(rt->stream, &pkt, rt->in_chunk_size, + &rt->prev_pkt[0], &rt->nb_prev_pkt[0])) < 0) + return ret; + } + cp = pkt.data; bytestream2_init(&gbc, cp, pkt.size); if (ff_amf_read_string(&gbc, command, sizeof(command), &stringlen)) { |