aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2017-01-25 15:59:09 +0100
committerLuca Barbato <lu_zero@gentoo.org>2017-01-29 18:10:44 +0100
commit11e225db31dcad57e2219ad8dfae2ac027af53d6 (patch)
tree1a2d5e8bb433bfb627074c030bca5d35932ebe92
parentca6ae3b77a7e6600e517723b90e57527a47809de (diff)
downloadffmpeg-11e225db31dcad57e2219ad8dfae2ac027af53d6.tar.gz
rtmp: Account for bytes_read wraparound
Servers seem to be happy to receive the wrapped-around value as long as they receive a report, otherwise they timeout. Initially reported and analyzed by Thomas Bernhard.
-rw-r--r--libavformat/rtmpproto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 5298c18790..49a40dd66a 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2416,7 +2416,7 @@ static int get_packet(URLContext *s, int for_header)
rt->last_timestamp = rpkt.timestamp;
rt->bytes_read += ret;
- if (rt->bytes_read > rt->last_bytes_read + rt->client_report_size) {
+ if (rt->bytes_read - rt->last_bytes_read > rt->client_report_size) {
av_log(s, AV_LOG_DEBUG, "Sending bytes read report\n");
if ((ret = gen_bytes_read(s, rt, rpkt.timestamp + 1)) < 0)
return ret;