summaryrefslogtreecommitdiff
path: root/libavformat/rtmpproto.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-10-02 01:59:22 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-10-02 02:16:14 +0200
commit94d50b5d00ced1d341cf8bfd3f318ebec76dbdea (patch)
treea73ab6560788a4d7e248e53511020ca8baad96c1 /libavformat/rtmpproto.c
parentac7b1f742324358e38a3354b9a4b4863042dd927 (diff)
downloadffmpeg-94d50b5d00ced1d341cf8bfd3f318ebec76dbdea.tar.gz
avformat/rtmpproto: Fix 2 more cases of the 2nd packet size being wrong
This should fix RTMP input which was broken by cbbd906be6150be38dfc14b6bc67dcac8da8aea4 the 40 + 11 case is untested as it did not occur in the testcase Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r--libavformat/rtmpproto.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 73ba89bec2..2e33dc8fea 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2368,8 +2368,9 @@ static int handle_metadata(RTMPContext *rt, RTMPPacket *pkt)
bytestream_put_be24(&p, ts);
bytestream_put_byte(&p, ts >> 24);
memcpy(p, next, size + 3 + 4);
+ p += size + 3;
+ bytestream_put_be32(&p, size + 11);
next += size + 3 + 4;
- p += size + 3 + 4;
}
if (p != rt->flv_data + rt->flv_size) {
av_log(NULL, AV_LOG_WARNING, "Incomplete flv packets in "
@@ -2559,7 +2560,7 @@ static int inject_fake_duration_metadata(RTMPContext *rt)
// Finalise object
bytestream_put_be16(&p, 0); // Empty string
bytestream_put_byte(&p, AMF_END_OF_OBJECT);
- bytestream_put_be32(&p, 40); // size of data part (sum of all parts below)
+ bytestream_put_be32(&p, 40 + 11); // size of data part (sum of all parts below)
return 0;
}