summaryrefslogtreecommitdiff
authorMichael Niedermayer <michaelni@gmx.at>2013-01-04 12:29:09 (GMT)
committer Michael Niedermayer <michaelni@gmx.at>2013-01-04 12:29:15 (GMT)
commita08194b4c51ebc7024f50eed0f09aa74058e15bb (patch)
tree1716b42c83f77e09dd934d3d4fd58e784e8e547a
parent8d0b2aae71f01904e4a7ac0e8795592da5a0bd89 (diff)
parentbe6cde3ce86e9ecf9b52309d7ca68c410ced525d (diff)
downloadffmpeg-a08194b4c51ebc7024f50eed0f09aa74058e15bb.zip
ffmpeg-a08194b4c51ebc7024f50eed0f09aa74058e15bb.tar.gz
ffmpeg-a08194b4c51ebc7024f50eed0f09aa74058e15bb.tar.bz2
Merge remote-tracking branch 'qatar/master'
* qatar/master: lavr: fix missing " in header documentation aviobuf: Discard old buffered, previously read data in ffio_read_partial Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat
-rw-r--r--libavformat/aviobuf.c7
-rw-r--r--libavresample/avresample.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 95a41bb..7a73a17 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -538,6 +538,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;
}
diff --git a/libavresample/avresample.h b/libavresample/avresample.h
index 34998aa..0012787 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