summaryrefslogtreecommitdiff
path: root/libavformat/rtmpproto.c
diff options
context:
space:
mode:
authorJosh Allmann <joshua.allmann@gmail.com>2013-09-16 23:58:48 -0700
committerMartin Storsjö <martin@martin.st>2013-09-17 23:19:11 +0300
commit8583b14252deac71136f1dec231910abab0ba503 (patch)
tree168eed6f41d80315d484ab8257a606b0eeb5daba /libavformat/rtmpproto.c
parentd4c2a3740fb95f952a87ba320d2bf31f126bdf68 (diff)
rtmp: Support reading interleaved chunks.
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ö <martin@martin.st>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r--libavformat/rtmpproto.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index ab30b19a26..9bdee5dd3f 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2309,7 +2309,7 @@ static int get_packet(URLContext *s, int for_header)
static int rtmp_close(URLContext *h)
{
RTMPContext *rt = h->priv_data;
- int ret = 0;
+ int ret = 0, i, j;
if (!rt->is_input) {
rt->flv_data = NULL;
@@ -2320,6 +2320,9 @@ static int rtmp_close(URLContext *h)
}
if (rt->state > STATE_HANDSHAKED)
ret = gen_delete_stream(h, rt);
+ for (i = 0; i < 2; i++)
+ for (j = 0; j < RTMP_CHANNELS; j++)
+ ff_rtmp_packet_destroy(&rt->prev_pkt[i][j]);
free_tracked_methods(rt);
av_freep(&rt->flv_data);