[FFmpeg-cvslog] rtmpproto: Add a comment explaining the logic in handle_notify

Martin Storsjö git at videolan.org
Fri Sep 20 15:35:46 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Thu Sep 19 12:48:04 2013 +0300| [b97b1adb3f807e1acd00d56319ee6cb41cc727e4] | committer: Martin Storsjö

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 at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b97b1adb3f807e1acd00d56319ee6cb41cc727e4
---

 libavformat/rtmpproto.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index e404d60..a0ef268 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;



More information about the ffmpeg-cvslog mailing list