From 53c25ee0736497b46bb76064cc2c84c976b2d295 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Wed, 2 Jan 2013 00:25:37 +0200
Subject: [PATCH 1/2] aviobuf: Discard old buffered, previously read data in
 ffio_read_partial
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This makes RTP custom IO work properly with pure read-only
AVIOContexts as well.

Signed-off-by: Martin Storsjö <martin@martin.st>
---
 libavformat/aviobuf.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 8f3e511fc4..d2eaf36b87 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -506,6 +506,13 @@ int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size)
 
     len = s->buf_end - s->buf_ptr;
     if (len == 0) {
+        /* Reset the buf_end pointer to the start of the buffer, to make sure
+         * the fill_buffer call tries to read as much data as fits into the
+         * full buffer, instead of just what space is left after buf_end.
+         * This avoids returning partial packets at the end of the buffer,
+         * for packet based inputs.
+         */
+        s->buf_end = s->buf_ptr = s->buffer;
         fill_buffer(s);
         len = s->buf_end - s->buf_ptr;
     }

From be6cde3ce86e9ecf9b52309d7ca68c410ced525d Mon Sep 17 00:00:00 2001
From: Peter Meerwald <p.meerwald@bct-electronic.com>
Date: Thu, 3 Jan 2013 14:17:29 +0100
Subject: [PATCH 2/2] lavr: fix missing " in header documentation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
---
 libavresample/avresample.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavresample/avresample.h b/libavresample/avresample.h
index 34998aa0cc..0012787404 100644
--- a/libavresample/avresample.h
+++ b/libavresample/avresample.h
@@ -49,7 +49,7 @@
  * av_opt_set_int(avr, "in_sample_rate",     48000,                0);
  * av_opt_set_int(avr, "out_sample_rate",    44100,                0);
  * av_opt_set_int(avr, "in_sample_fmt",      AV_SAMPLE_FMT_FLTP,   0);
- * av_opt_set_int(avr, "out_sample_fmt,      AV_SAMPLE_FMT_S16,    0);
+ * av_opt_set_int(avr, "out_sample_fmt",     AV_SAMPLE_FMT_S16,    0);
  * @endcode
  *
  * Once the context is initialized, it must be opened with avresample_open(). If