rtmp: Don't blindly skip the 4 trailer bytes from the FLV packets
authorMartin Storsjö <martin@martin.st>
Tue, 20 Sep 2011 13:00:52 +0000 (16:00 +0300)
committerMartin Storsjö <martin@martin.st>
Tue, 20 Sep 2011 13:23:48 +0000 (16:23 +0300)
commit3ffe32eb96e2414bdd87b353953d77fb83eca8ae
tree6440de6f6860987e66db9f46acfb26e9b139c38a
parenta14c784210198fe830391a59897d4dc62f13ab84
rtmp: Don't blindly skip the 4 trailer bytes from the FLV packets

If not enough bytes are available, keep track of them and skip
them on next call.

In practice, if these trailer bytes are written in a separate
call, there is no other data written in this call, making it
fall into the "FLV packet too small" case currently - working,
but not as intended.

This patch makes the code more robust, handling all cases
except for having the FLV packet header split over multiple
write calls.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtmpproto.c