diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-09-19 01:49:41 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-19 11:27:21 +0200 |
commit | fbd54827b1be23c1a234210df5cc876665fbd941 (patch) | |
tree | f3bfd10a737cb8939648e2beecff5244ed6fc0c9 /libavformat/rtmpproto.c | |
parent | 20dfab33f5ab61fc51de65192ed239f8b62782a2 (diff) | |
download | ffmpeg-fbd54827b1be23c1a234210df5cc876665fbd941.tar.gz |
rtmp: Unbreak handle_notify
Commit 5626f994f273af80fb100d4743b963304de9e05c broke it.
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r-- | libavformat/rtmpproto.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 8be5cb47ed..020f76ff2d 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -2067,7 +2067,7 @@ static int handle_notify(URLContext *s, RTMPPacket *pkt) { GetByteContext gbc; PutByteContext pbc; uint32_t ts; - int old_flv_size; + int old_flv_size, err; const uint8_t *datatowrite; unsigned datatowritelength; @@ -2095,22 +2095,23 @@ static int handle_notify(URLContext *s, RTMPPacket *pkt) { old_flv_size = rt->flv_size; rt->flv_size += datatowritelength + 15; } else { - int err; old_flv_size = 0; rt->flv_size = datatowritelength + 15; rt->flv_off = 0; - if ((err = av_reallocp(&rt->flv_data, rt->flv_size)) < 0) - return err; - bytestream2_init_writer(&pbc, rt->flv_data, rt->flv_size); - bytestream2_skip_p(&pbc, old_flv_size); - bytestream2_put_byte(&pbc, pkt->type); - bytestream2_put_be24(&pbc, datatowritelength); - bytestream2_put_be24(&pbc, ts); - bytestream2_put_byte(&pbc, ts >> 24); - bytestream2_put_be24(&pbc, 0); - bytestream2_put_buffer(&pbc, datatowrite, datatowritelength); - bytestream2_put_be32(&pbc, 0); } + + if ((err = av_reallocp(&rt->flv_data, rt->flv_size)) < 0) + return err; + bytestream2_init_writer(&pbc, rt->flv_data, rt->flv_size); + bytestream2_skip_p(&pbc, old_flv_size); + bytestream2_put_byte(&pbc, pkt->type); + bytestream2_put_be24(&pbc, datatowritelength); + bytestream2_put_be24(&pbc, ts); + bytestream2_put_byte(&pbc, ts >> 24); + bytestream2_put_be24(&pbc, 0); + bytestream2_put_buffer(&pbc, datatowrite, datatowritelength); + bytestream2_put_be32(&pbc, 0); + return 0; } |