[FFmpeg-cvslog] doc/filters: update filter buffer/abuffer interface file name
ffmpeg | branch: master | tomajsjiang | Thu Aug 6 09:51:11 2020 +0800| [926061fff1dea1463cb8810305f814e784d8ad60] | committer: Jun Zhao doc/filters: update filter buffer/abuffer interface file name Update filter buffer/abuffer interface file name, from libavfilter/{vsrc|asrc_buffer.h} to libavfilter/buffersrc.h Reviewed-by: Gyan Doshi Signed-off-by: Jun Zhao Signed-off-by: tomajsjiang > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=926061fff1dea1463cb8810305f814e784d8ad60 --- doc/filters.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 561aa98a9d..d8cd45066a 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -5798,7 +5798,7 @@ Below is a description of the currently available audio sources. Buffer audio frames, and make them available to the filter chain. This source is mainly intended for a programmatic use, in particular -through the interface defined in @file{libavfilter/asrc_abuffer.h}. +through the interface defined in @file{libavfilter/buffersrc.h}. It accepts the following parameters: @table @option @@ -22232,7 +22232,7 @@ Below is a description of the currently available video sources. Buffer video frames, and make them available to the filter chain. This source is mainly intended for a programmatic use, in particular -through the interface defined in @file{libavfilter/vsrc_buffer.h}. +through the interface defined in @file{libavfilter/buffersrc.h}. It accepts the following parameters: ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavf/utils: fix error like "offset 0x1f85: partial file"
ffmpeg | branch: master | tomajsjiang | Wed Aug 7 22:48:28 2019 +0800| [9c3adb7ce23522dcceb264bc0bffd3592dd3e1a5] | committer: Jun Zhao lavf/utils: fix error like "offset 0x1f85: partial file" fix error like "offset 0x1f85: partial file", the root cause is when read the mp4 file from http, and the moov in the end of the mp4 file, reconfig the buffer will drop some data. Signed-off-by: Jun Zhao Signed-off-by: Zhongxing Jiang > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9c3adb7ce23522dcceb264bc0bffd3592dd3e1a5 --- libavformat/utils.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 6c6f4e1bd1..b57e680089 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2136,7 +2136,13 @@ void ff_configure_buffers_for_index(AVFormatContext *s, int64_t time_tolerance) /* XXX This could be adjusted depending on protocol*/ if (s->pb->buffer_size < pos_delta && pos_delta < (1<<24)) { av_log(s, AV_LOG_VERBOSE, "Reconfiguring buffers to size %"PRId64"\n", pos_delta); -ffio_set_buf_size(s->pb, pos_delta); + +/* realloc the buffer and the original data will be retained */ +if (ffio_realloc_buf(s->pb, pos_delta)) { +av_log(s, AV_LOG_ERROR, "Realloc buffer fail.\n"); +return; +} + s->pb->short_seek_threshold = FFMAX(s->pb->short_seek_threshold, pos_delta/2); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lavf/avio: add a ffio_realloc_buf API for AVIO buffer realloc
ffmpeg | branch: master | tomajsjiang | Thu Jul 4 11:58:41 2019 +0800| [3d1506c630eb59b428eb3585ccaa446fec7f3b0a] | committer: Jun Zhao lavf/avio: add a ffio_realloc_buf API for AVIO buffer realloc Add new API ffio_realloc_buf for AVIO buffer realloc. Signed-off-by: Zhongxing Jiang > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d1506c630eb59b428eb3585ccaa446fec7f3b0a --- libavformat/avio_internal.h | 9 + libavformat/aviobuf.c | 31 +++ 2 files changed, 40 insertions(+) diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h index 04c1ad5157..eb628ac493 100644 --- a/libavformat/avio_internal.h +++ b/libavformat/avio_internal.h @@ -87,6 +87,15 @@ int ffio_read_size(AVIOContext *s, unsigned char *buf, int size); int ffio_set_buf_size(AVIOContext *s, int buf_size); /** + * Reallocate a given buffer for AVIOContext. + * + * @param s the AVIOContext to realloc. + * @param buf_size required new buffer size. + * @return 0 on success, a negative AVERROR on failure. + */ +int ffio_realloc_buf(AVIOContext *s, int buf_size); + +/** * Ensures that the requested seekback buffer size will be available * * Will ensure that when reading sequentially up to buf_size, seeking diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index c76df714ad..a69c30e0af 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -1096,6 +1096,37 @@ int ffio_set_buf_size(AVIOContext *s, int buf_size) return 0; } +int ffio_realloc_buf(AVIOContext *s, int buf_size) +{ +uint8_t *buffer; +int data_size; + +if (!s->buffer_size) +return ffio_set_buf_size(s, buf_size); + +if (buf_size <= s->buffer_size) +return 0; + +buffer = av_malloc(buf_size); +if (!buffer) +return AVERROR(ENOMEM); + +data_size = s->write_flag ? (s->buf_ptr - s->buffer) : (s->buf_end - s->buf_ptr); +if (data_size > 0) +memcpy(buffer, s->write_flag ? s->buffer : s->buf_ptr, data_size); +av_free(s->buffer); +s->buffer = buffer; +s->orig_buffer_size = buf_size; +s->buffer_size = buf_size; +s->buf_ptr = s->write_flag ? (s->buffer + data_size) : s->buffer; +if (s->write_flag) +s->buf_ptr_max = s->buffer + data_size; + +s->buf_end = s->write_flag ? (s->buffer + s->buffer_size) : (s->buf_ptr + data_size); + +return 0; +} + static int url_resetbuf(AVIOContext *s, int flags) { av_assert1(flags == AVIO_FLAG_WRITE || flags == AVIO_FLAG_READ); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".