From 8583b14252deac71136f1dec231910abab0ba503 Mon Sep 17 00:00:00 2001 From: Josh Allmann Date: Mon, 16 Sep 2013 23:58:48 -0700 Subject: rtmp: Support reading interleaved chunks. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A given packet won't always come in contiguously; sometimes they may be broken up on chunk boundaries by packets of another channel. This support primarily involves tracking information about the data that's been read, so the reader can pick up where it left off for a given channel. As a side effect, we no longer over-report the bytes read if (toread = MIN(size, chunk_size)) == size Signed-off-by: Martin Storsjö --- libavformat/rtmppkt.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat/rtmppkt.h') diff --git a/libavformat/rtmppkt.h b/libavformat/rtmppkt.h index e3120becc9..ce326d15db 100644 --- a/libavformat/rtmppkt.h +++ b/libavformat/rtmppkt.h @@ -82,6 +82,8 @@ typedef struct RTMPPacket { uint32_t extra; ///< probably an additional channel ID used during streaming data uint8_t *data; ///< packet payload int size; ///< packet payload size + int offset; ///< amount of data read so far + int read; ///< amount read, including headers } RTMPPacket; /** -- cgit v1.2.3