aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-19 12:48:04 +0300
committerMartin Storsjö <martin@martin.st>2013-09-20 10:47:15 +0300
commitb97b1adb3f807e1acd00d56319ee6cb41cc727e4 (patch)
treec3e68178427f3ba55bd6f965f4387fffcbe1ce58 /libavformat
parente5d45e028cf4193b562075897e55091779e49f15 (diff)
downloadffmpeg-b97b1adb3f807e1acd00d56319ee6cb41cc727e4.tar.gz
rtmpproto: Add a comment explaining the logic in handle_notify
This explains why the cleanup in 5626f994f was wrong and why ae0f316a was needed. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rtmpproto.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index e404d60ca4..a0ef268428 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2095,9 +2095,11 @@ static int handle_notify(URLContext *s, RTMPPacket *pkt) {
// generate packet header and put data into buffer for FLV demuxer
if (rt->flv_off < rt->flv_size) {
+ // There is old unread data in the buffer, thus append at the end
old_flv_size = rt->flv_size;
rt->flv_size += datatowritelength + 15;
} else {
+ // All data has been read, write the new data at the start of the buffer
old_flv_size = 0;
rt->flv_size = datatowritelength + 15;
rt->flv_off = 0;