From patchwork Sat Jan 14 18:22:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 2217 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp699430vsb; Sat, 14 Jan 2017 10:22:18 -0800 (PST) X-Received: by 10.28.164.196 with SMTP id n187mr6214131wme.44.1484418137940; Sat, 14 Jan 2017 10:22:17 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o39si552205wrc.14.2017.01.14.10.22.17; Sat, 14 Jan 2017 10:22:17 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BAF2F68A4DC; Sat, 14 Jan 2017 20:22:06 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-2.mx.upcmail.net (vie01a-qmta-pe01-2.mx.upcmail.net [62.179.121.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 952DF68A4CC for ; Sat, 14 Jan 2017 20:22:00 +0200 (EET) Received: from [172.31.218.31] (helo=vie01a-dmta-pe01-1.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cSSxs-0005Ri-TF for ffmpeg-devel@ffmpeg.org; Sat, 14 Jan 2017 19:22:08 +0100 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cSSxm-0007hy-W0 for ffmpeg-devel@ffmpeg.org; Sat, 14 Jan 2017 19:22:02 +0100 Received: from [192.168.1.3] ([80.110.111.93]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id YJN11u01120xKx401JN2Hw; Sat, 14 Jan 2017 19:22:02 +0100 X-SourceIP: 80.110.111.93 From: Carl Eugen Hoyos To: FFmpeg development discussions and patches Date: Sat, 14 Jan 2017 19:22:01 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Message-Id: <201701141922.01423.cehoyos@ag.or.at> Subject: [FFmpeg-devel] [PATCH]lavf/rtmpproto: Make bytes_read variables 64bit. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! Attached patch is meant to fix ticket #5836, completely untested. Please comment, Carl Eugen From b6d895a9bf1a4ed9d1660d99043b8edc5cc8b169 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sat, 14 Jan 2017 19:17:09 +0100 Subject: [PATCH] lavf/rtmpproto: Make bytes_read variables 64bit. When bytes_read overflowed, last_bytes_read did not yet overflow and no bytes-read report was created leading to a timeout. Analyzed-by: Thomas Bernhard Fixes ticket #5836. --- libavformat/rtmpproto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index b118b4e..5d7ad79 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -94,8 +94,8 @@ typedef struct RTMPContext { int flv_nb_packets; ///< number of flv packets published RTMPPacket out_pkt; ///< rtmp packet, created from flv a/v or metadata (for output) uint32_t client_report_size; ///< number of bytes after which client should report to server - uint32_t bytes_read; ///< number of bytes read from server - uint32_t last_bytes_read; ///< number of bytes read last reported to server + uint64_t bytes_read; ///< number of bytes read from server + uint64_t last_bytes_read; ///< number of bytes read last reported to server uint32_t last_timestamp; ///< last timestamp received in a packet int skip_bytes; ///< number of bytes to skip from the input FLV stream in the next write call int has_audio; ///< presence of audio data