Statistics
| Branch: | Revision:

ffmpeg / libavformat / aviobuf.c @ 2912e87a

History | View | Annotate | Download (27.2 KB)

# Date Author Comment
2912e87a 03/19/2011 01:33 PM Mans Rullgard

Replace FFmpeg with Libav in licence headers

Signed-off-by: Mans Rullgard <>

b7f2fdde 03/17/2011 02:59 AM Anton Khirnov

avio: rename put_flush_packet -> avio_flush

Signed-off-by: Ronald S. Bultje <>

35f10235 03/17/2011 02:59 AM Anton Khirnov

avio: deprecate url_close_buf

It's not used anywhere and its return value looks broken.

Signed-off-by: Ronald S. Bultje <>

83fddaeb 03/17/2011 02:59 AM Anton Khirnov

avio: deprecate url_open_buf

It's only used in one place and does the same thing as
avio_alloc_context.

Signed-off-by: Ronald S. Bultje <>

eda4cf92 03/17/2011 02:59 AM Anton Khirnov

avio: always compile avio_printf, rather than on CONFIG_MUXERS

Signed-off-by: Ronald S. Bultje <>

d9d86e00 03/17/2011 02:59 AM Anton Khirnov

avio: avio_ prefix for url_fprintf

Signed-off-by: Ronald S. Bultje <>

59f65d95 03/17/2011 02:59 AM Anton Khirnov

avio: make url_setbufsize internal.

Signed-off-by: Ronald S. Bultje <>

4839c192 03/17/2011 02:59 AM Anton Khirnov

lavf: move ff_get_v from avio.h to avio_internal.h

And rename it to ffio_read_varlen.

Signed-off-by: Ronald S. Bultje <>

3e68b3ba 03/15/2011 12:04 PM Anton Khirnov

avio: deprecate url_ferror

AVIOContext.error should be used directly instead.

Signed-off-by: Ronald S. Bultje <>

66e5b1df 03/07/2011 10:20 PM Anton Khirnov

avio: deprecate url_feof

AVIOContext.eof_reached should be used directly instead.

Signed-off-by: Ronald S. Bultje <>

f1ef2cd9 03/07/2011 05:25 PM Anton Khirnov

avio: move ff_rewind_with_probe_data from avio.h to avio_internal.h

also change its prefix to ffio

Signed-off-by: Ronald S. Bultje <>

e8bb2e24 03/07/2011 05:25 PM Anton Khirnov

avio: deprecate url_fget_max_packet_size

AVIOContext.max_packet_size should be used directly instead.

Signed-off-by: Ronald S. Bultje <>

76aa876e 03/07/2011 04:03 PM Anton Khirnov

avio: avio_ prefix for url_fsize

Signed-off-by: Ronald S. Bultje <>

e5197539 03/07/2011 03:51 PM Anton Khirnov

avio: deprecate url_fgetc and remove all it uses

Signed-off-by: Ronald S. Bultje <>

655e45e7 03/07/2011 03:19 PM Anton Khirnov

avio: deprecate url_fgets

It's not used anywhere and doesn't look ver useful to be public.

Signed-off-by: Ronald S. Bultje <>

a2704c97 03/04/2011 04:26 PM Anton Khirnov

avio: add avio_tell macro as a replacement for url_ftell

Signed-off-by: Ronald S. Bultje <>

e16ead07 03/04/2011 04:26 PM Anton Khirnov

lavf: deprecate get_strz() in favor of avio_get_str

Signed-off-by: Ronald S. Bultje <>

41d8555f 03/04/2011 04:24 PM Reimar Döffinger

avio: add avio_get_str()

Signed-off-by: Ronald S. Bultje <>

e360ada2 03/02/2011 10:16 AM Martin Storsjö

aviobuf: Write new data at s->buf_end in fill_buffer

In most cases, s->buf_ptr will be equal to s->buf_end when
fill_buffer is called, but this may not always be the case, if
we're seeking forward by reading (permitted by the short seek
threshold).

If fill_buffer is writing to s->buf_ptr instead of s->buf_end (when...

0300db8a 03/01/2011 05:27 PM Anton Khirnov

avio: deprecate url_fskip

avio_seek should be used instead

Signed-off-by: Ronald S. Bultje <>

6b4aa5da 03/01/2011 05:12 PM Anton Khirnov

avio: avio_ prefix for url_fseek

Signed-off-by: Ronald S. Bultje <>

61840b43 02/25/2011 07:38 PM Anton Khirnov

avio: deprecate put_tag

it's not used internally anymore and shouldn't be public.

Signed-off-by: Ronald S. Bultje <>

22a3212e 02/23/2011 03:18 PM Anton Khirnov

avio: rename url_fopen/fclose -> avio_open/close.

Signed-off-by: Ronald S. Bultje <>

0ac8e2bf 02/21/2011 07:25 PM Anton Khirnov

avio: make put_nbyte internal.

Signed-off-by: Ronald S. Bultje <>

77eb5504 02/21/2011 07:25 PM Anton Khirnov

avio: avio: avio_ prefixes for put_* functions

In the name of consistency:
put_byte -> avio_w8
put_<type> -> avio_w<type>
put_buffer -> avio_write

put_nbyte will be made private
put_tag will be merged with avio_put_str

Signed-off-by: Ronald S. Bultje <>

b3db9cee 02/21/2011 06:40 PM Anton Khirnov

avio: make get_partial_buffer internal.

Signed-off-by: Ronald S. Bultje <>

b7effd4e 02/21/2011 04:23 PM Anton Khirnov

avio: avio_ prefixes for get_* functions

In the name of consistency:
get_byte -> avio_r8
get_<type> -> avio_r<type>
get_buffer -> avio_read

get_partial_buffer will be made private later

get_strz is left out becase I want to change it later to return...

8d9ac969 02/21/2011 03:23 PM Anton Khirnov

avio: rename av_alloc_put_byte -> avio_alloc_context for consistency

Signed-off-by: Ronald S. Bultje <>

e731b8d8 02/20/2011 01:37 PM Anton Khirnov

avio: move init_put_byte() to a new private header and rename it

init_put_byte should never be used outside of lavf, since
sizeof(AVIOContext) isn't part of public ABI.

Signed-off-by: Ronald S. Bultje <>

ae628ec1 02/20/2011 01:37 PM Anton Khirnov

avio: rename ByteIOContext to AVIOContext.

Signed-off-by: Ronald S. Bultje <>

93b78d12 01/25/2011 08:48 PM Anton Khirnov

lavf: make a variant of ff_get_str16_nolen public

It will be useful in mp3 demuxer and hopeful some other places.

Signed-off-by: Janne Grunau <>

dccbd97d 01/21/2011 08:21 PM Anton Khirnov

lavf: move ff_put_str16_nolen from asf to avio and rename it

It will be useful in the mp3 muxer.

Signed-off-by: Mans Rullgard <>

4efd5cf3 01/21/2011 08:21 PM Anton Khirnov

avio: add av_put_str and deprecate put_strz in favor of it

Signed-off-by: Mans Rullgard <>

c66f53cf 01/13/2011 06:22 AM Martin Storsjö

Revert aviobuf: Retry if the read/write function returns AVERROR

This reverts SVN commit 26318, which broke MS-RTSP playback.

Originally committed as revision 26326 to svn://svn.ffmpeg.org/ffmpeg/trunk

a6963f83 01/12/2011 07:06 AM Martin Storsjö

aviobuf: Retry if the read/write function returns AVERROR

Originally committed as revision 26318 to svn://svn.ffmpeg.org/ffmpeg/trunk

17ee8f66 01/02/2011 10:45 AM Anssi Hannula

Add function put_nbyte() to speed up padding in SPDIF muxer.

Patch by Anssi Hannula, anssi d hannula a iki d fi

Originally committed as revision 26193 to svn://svn.ffmpeg.org/ffmpeg/trunk

364cacc7 08/19/2010 09:28 PM Aurelien Jacobs

add FF_API_URL_RESETBUF define to disable the deprecated url_resetbuf()
public function

Originally committed as revision 24841 to svn://svn.ffmpeg.org/ffmpeg/trunk

853a0fcc 07/25/2010 02:35 PM Reimar Döffinger

Cosmetics: fix indentation and remove a useless else.

Originally committed as revision 24495 to svn://svn.ffmpeg.org/ffmpeg/trunk

3aa13da9 07/25/2010 02:33 PM Reimar Döffinger

Simplify get_byte and url_fgetc.

Originally committed as revision 24494 to svn://svn.ffmpeg.org/ffmpeg/trunk

496c645d 07/24/2010 09:04 AM Martin Storsjö

Never shrink the ByteIOContext buffer in ff_rewind_with_probe_data

If there is little unread data in the ByteIOContext buffer, this may lead
to reducing the size of the ByteIOContext buffer to little more the probe
data size. This can lead to suboptimal aviobuf behaviour, e.g. making some...

a43416a5 07/21/2010 09:40 PM Aurelien Jacobs

improve ff_get_line to return line length

Originally committed as revision 24400 to svn://svn.ffmpeg.org/ffmpeg/trunk

7c892951 07/21/2010 09:39 PM Aurelien Jacobs

move ff_get_line to aviobuf.c

Originally committed as revision 24399 to svn://svn.ffmpeg.org/ffmpeg/trunk

aff4137d 07/20/2010 09:58 AM Martin Storsjö

Remove an assert that was no longer correct nor relevant

Originally committed as revision 24344 to svn://svn.ffmpeg.org/ffmpeg/trunk

7939d0ed 07/17/2010 05:26 AM Martin Storsjö

aviobuf: Do short seeks forward by reading and skipping data instead of a proper seek

This improves performance on e.g. seekable http.

Originally committed as revision 24280 to svn://svn.ffmpeg.org/ffmpeg/trunk

d5e9ddeb 07/16/2010 11:20 PM Martin Storsjö

url_fskip: Return an error code if the url_fseek failed

Originally committed as revision 24277 to svn://svn.ffmpeg.org/ffmpeg/trunk

603e5c0b 07/09/2010 12:14 PM Michael Chinen

move ff_get_v_length and ff_put_v from nutenc.c to internal.h/aviobuf.c

patch by Micheal Chinen < mchinen gmail >

Originally committed as revision 24140 to svn://svn.ffmpeg.org/ffmpeg/trunk

6fa197e2 07/05/2010 09:11 AM Eli Friedman

Silence a warning when compiling aviobuf.c

Patch by Eli Friedman, eli d friedman a gmail

Originally committed as revision 24055 to svn://svn.ffmpeg.org/ffmpeg/trunk

de1807bb 07/01/2010 08:15 PM Josh Allmann

Pad the buffer in url_close_dyn_buf, for buffers opened with url_open_dyn_buf

Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 23942 to svn://svn.ffmpeg.org/ffmpeg/trunk

9d30e068 04/21/2010 09:19 PM Stefano Sabatini

Do not initialize res in url_fseek(), in the case !s->seek directly
return AVERROR rather than the pre-defined value of res.

Slightly improve readability.

Originally committed as revision 22939 to svn://svn.ffmpeg.org/ffmpeg/trunk

4c4ef3db 04/18/2010 05:37 PM Stefano Sabatini

Make url_fsize() return AVERROR rather than AVERROR if
the seek operation is not defined in the ByteIOContext.

Originally committed as revision 22902 to svn://svn.ffmpeg.org/ffmpeg/trunk

c007c687 04/12/2010 03:03 PM Howard Chu

Do not set pos to an error value.

Patch by Howard Chu, hyc highlandsun com

Originally committed as revision 22853 to svn://svn.ffmpeg.org/ffmpeg/trunk

7a6fe01f 04/08/2010 09:47 AM Tomas Härdin

Seeking forward in non-seekable media by discarding data, regardless of how far to seek. Won't SEEK_END unless forced though.

Originally committed as revision 22822 to svn://svn.ffmpeg.org/ffmpeg/trunk

01d91b9b 04/08/2010 09:02 AM Tomas Härdin

Reusing the probe buffer to rewind the ByteIOContext in ff_probe_input_buffer() instead of seeking back to the start of the file. Once exhausted, the size of the buffer is reduced.

Originally committed as revision 22821 to svn://svn.ffmpeg.org/ffmpeg/trunk

c6a5e087 03/24/2010 10:41 AM Tomas Härdin

Mask away AVSEEK_FORCE properly in some checks in url_fseek()
Patch by Tomas Härdin $(name).$(s/ä/a/ $(surname)) AT codemill DOT se

Originally committed as revision 22653 to svn://svn.ffmpeg.org/ffmpeg/trunk

8d5e638f 03/18/2010 12:22 AM Stefano Sabatini

Make url_fseek() return AVERROR_EOF rather than AVERROR if end
of file is reached.

Originally committed as revision 22590 to svn://svn.ffmpeg.org/ffmpeg/trunk

493f54ad 03/15/2010 10:54 PM Michael Niedermayer

Add AVSEEK_FORCE flag to indicate that the code should attempt to seek
by any means.

Originally committed as revision 22557 to svn://svn.ffmpeg.org/ffmpeg/trunk

8757dc5e 01/30/2010 08:18 PM Stefano Sabatini

Remove duplicated empty line.

Originally committed as revision 21553 to svn://svn.ffmpeg.org/ffmpeg/trunk

08580cb0 10/20/2009 06:40 AM Benoit Fouet

Make url_resetbuf() assert on wrong flags passed and make it static on next
version bump.
See thread: [FFmpeg-devel] & vs. &&
Date: Mon, 12 Oct 2009 14:21:06 +0200

Originally committed as revision 20330 to svn://svn.ffmpeg.org/ffmpeg/trunk

90aa6ace 10/12/2009 04:38 PM Reimar Döffinger

Merge declaration and initialization

Originally committed as revision 20214 to svn://svn.ffmpeg.org/ffmpeg/trunk

098d8e09 10/12/2009 04:36 PM Reimar Döffinger

Simplify: use FFMIN

Originally committed as revision 20213 to svn://svn.ffmpeg.org/ffmpeg/trunk

7f7686df 10/02/2009 06:36 AM Reimar Döffinger

Make get_buffer and get_partial_buffer return url_ferror or AVERROR_EOF as
appropriate if it couldn't read any data at all.
This should make handling of EOF and error simpler or make it work right without
extra code in a few place (e.g. raw demuxer).

Originally committed as revision 20135 to svn://svn.ffmpeg.org/ffmpeg/trunk

b3eab9fb 04/13/2009 04:02 AM Baptiste Coudurier

seek inside buffer when offset is exactly at the end, fix seeking with memory ByteIOContext

Originally committed as revision 18487 to svn://svn.ffmpeg.org/ffmpeg/trunk

0c5a43d6 01/16/2009 04:39 PM Reimar Döffinger

Merge declaration and initialization of io_buffer_size

Originally committed as revision 16639 to svn://svn.ffmpeg.org/ffmpeg/trunk

2bdaf78c 01/16/2009 04:37 PM Reimar Döffinger

Make io_buffer_size unsigned to avoid a warning about comparing
signed and unsigned values.

Originally committed as revision 16638 to svn://svn.ffmpeg.org/ffmpeg/trunk

0e7ceb24 01/16/2009 03:35 PM Reimar Döffinger

Return AVERROR instead of -1 when malloc fails in url_open_dyn_buf_internal

Originally committed as revision 16636 to svn://svn.ffmpeg.org/ffmpeg/trunk

aa805f94 01/16/2009 03:34 PM Reimar Döffinger

Use AV_WB32 instead of reimplementing it.

Originally committed as revision 16635 to svn://svn.ffmpeg.org/ffmpeg/trunk

dc2c2eea 01/16/2009 03:32 PM Reimar Döffinger

Use av_mallocz instead of explicitly zeroing in url_open_dyn_buf_internal.

Originally committed as revision 16634 to svn://svn.ffmpeg.org/ffmpeg/trunk

7ce820ef 01/16/2009 03:30 PM Reimar Döffinger

Replace nonsense -1234 return value in dyn_buf_write by proper AVERROR

Originally committed as revision 16633 to svn://svn.ffmpeg.org/ffmpeg/trunk

b250f9c6 01/13/2009 11:44 PM Aurelien Jacobs

Change semantic of CONFIG_*, HAVE_* and ARCH_*.
They are now always defined to either 0 or 1.

Originally committed as revision 16590 to svn://svn.ffmpeg.org/ffmpeg/trunk

9daa4cea 12/22/2008 11:23 AM Aurelien Jacobs

Initialize s->opaque before calling url_resetbuf().
Fixes a regression test crash for icc 10.1 64 bit.

Patch by Aurelien.

Originally committed as revision 16271 to svn://svn.ffmpeg.org/ffmpeg/trunk

7f37f568 12/13/2008 01:39 PM Diego Biurrun

whitespace cosmetics

Originally committed as revision 16100 to svn://svn.ffmpeg.org/ffmpeg/trunk

f5edd874 11/10/2008 09:41 PM Jindřich Makovička

always use the whole buffer for reading w/ packetized sources to avoid packet truncation

Originally committed as revision 15799 to svn://svn.ffmpeg.org/ffmpeg/trunk

4589dc5c 10/18/2008 05:30 PM Michael Niedermayer

Append read data onto the buffer instead of overwriting, this ensures
that the whole buffer is available for seeking back.
Fixes issue480

Originally committed as revision 15634 to svn://svn.ffmpeg.org/ffmpeg/trunk

6bc03a69 10/04/2008 09:11 PM Reimar Döffinger

Make size variables in dyn_buf_write unsigned so gcc will not optimize the
check away (due to assuming signed overflows do not happen).

Originally committed as revision 15555 to svn://svn.ffmpeg.org/ffmpeg/trunk

bc5c918e 10/03/2008 10:16 AM Diego Biurrun

Remove offset_t typedef and use int64_t directly instead.
The name offset_t is easily confused with the standard off_t type and
*_t is POSIX reserved namespace if any POSIX header is included.

Originally committed as revision 15533 to svn://svn.ffmpeg.org/ffmpeg/trunk

39a127bf 07/31/2008 07:40 PM Baptiste Coudurier

Only reset buffer state if seeking is successful; update seek reg ref.

Originally committed as revision 14491 to svn://svn.ffmpeg.org/ffmpeg/trunk

245976da 05/09/2008 11:56 AM Diego Biurrun

Use full path for #includes from another directory.

Originally committed as revision 13098 to svn://svn.ffmpeg.org/ffmpeg/trunk

3abe5fbd 01/04/2008 11:09 PM Aurelien Jacobs

improve CRC API
- don't export any global var
- provide either generated or hardcoded tables

Originally committed as revision 11409 to svn://svn.ffmpeg.org/ffmpeg/trunk

1e0f3468 12/22/2007 04:18 PM Reimar Döffinger

Add a av_alloc_put_byte function.
The name is in analogy to init_put_byte, but I would not mind it
being changed to something better.

Originally committed as revision 11305 to svn://svn.ffmpeg.org/ffmpeg/trunk

b075e520 12/19/2007 09:11 PM Michael Niedermayer

Make recently added and still unused read_seek functions return offset_t.

Originally committed as revision 11274 to svn://svn.ffmpeg.org/ffmpeg/trunk

502bdf68 12/19/2007 08:57 PM Michael Niedermayer

Merge recently added and still unused play and pause functions.

Originally committed as revision 11273 to svn://svn.ffmpeg.org/ffmpeg/trunk

004050ee 12/19/2007 02:33 AM Michael Niedermayer

Remove unneeded avio wrapper functions.

Originally committed as revision 11264 to svn://svn.ffmpeg.org/ffmpeg/trunk

5cb4b82a 12/16/2007 05:52 PM Baptiste Coudurier

return error when url_fseek could not read until desired offset in streamed mode

Originally committed as revision 11233 to svn://svn.ffmpeg.org/ffmpeg/trunk

e7e4810a 11/28/2007 07:46 PM Björn Axelsson

Extend ByteIOContext and add the buffered IO functions:
av_url_read_fplay(), av_url_read_fpause() and av_url_read_fseek().

patch by: Björn Axelsson, bjorn d axelsson a intinor d se

Originally committed as revision 11110 to svn://svn.ffmpeg.org/ffmpeg/trunk

899681cd 11/21/2007 07:41 AM Björn Axelsson

Use dynamically allocated ByteIOContext in AVFormatContext

patch by: Björn Axelsson, bjorn d axelsson a intinor d se
thread: [PATCH] Remove static ByteIOContexts, 06 nov 2007

Originally committed as revision 11071 to svn://svn.ffmpeg.org/ffmpeg/trunk

7798b42d 11/03/2007 06:29 PM Kostya Shishkov

Add ff_ prefix to get_v()

Originally committed as revision 10912 to svn://svn.ffmpeg.org/ffmpeg/trunk

897d3eef 11/03/2007 06:26 PM Kostya Shishkov

Make get_v() available to the other demuxers

Originally committed as revision 10911 to svn://svn.ffmpeg.org/ffmpeg/trunk

992e78f5 10/30/2007 12:01 AM Baptiste Coudurier

rename av_crc04C11DB7_update to ff_crc04C11DB7_update and move it to aviobuf.c so it can be reused by other (de)muxers

Originally committed as revision 10873 to svn://svn.ffmpeg.org/ffmpeg/trunk

770d9daf 10/11/2007 02:57 PM Björn Axelsson

Add functionality to set the direction of a ByteIOContext buffer.
Patch by Björn Axelsson bjorn axelsson intinor se
Original thread: [FFmpeg-devel] [PATCH] MMS protocol support patch 1
Date: 09/19/2007 05:51 PM

Originally committed as revision 10709 to svn://svn.ffmpeg.org/ffmpeg/trunk

2d89f334 09/26/2007 11:33 AM Benoit Fouet

Indentation

Originally committed as revision 10589 to svn://svn.ffmpeg.org/ffmpeg/trunk

602dd8f6 09/26/2007 11:32 AM Benoit Fouet

Check read_packet before using it.

Originally committed as revision 10588 to svn://svn.ffmpeg.org/ffmpeg/trunk

6f3e0b21 07/19/2007 03:23 PM Panagiotis Issaris

Replace all occurrences of AVERROR_IO with AVERROR.

Originally committed as revision 9760 to svn://svn.ffmpeg.org/ffmpeg/trunk

5f097703 05/11/2007 07:07 PM Alex Beregszaszi

cosmetics: fix indentation

Originally committed as revision 8998 to svn://svn.ffmpeg.org/ffmpeg/trunk

a8c5ab27 03/05/2007 01:55 PM Panagiotis Issaris

Move aviobuf.c comments to avio.h. By moving the aviobuf.c comments to avio.h,
these comments can be extracted by Doxygen by only accessing the installed
headers.

Originally committed as revision 8258 to svn://svn.ffmpeg.org/ffmpeg/trunk

8fa36ae0 02/13/2007 06:26 PM François Revol

This fixes error handling for BeOS, removing the need for some ifdefs.
AVERROR_ defines are moved to avcodec.h as they are needed in there as well. Feel free to move that to avutil/common.h.
Bumped up avcodec/format version numbers as though it's binary compatible we will want to rebuild apps as error values changed....

68fcdbf1 01/30/2007 10:48 AM Ronald S. Bultje

Fix misbehaviour in url_fseek() when seeking fails.
The return value of the seek function is -1 on error, not -EPIPE (the return value in url_seek() if no seek function pointer is set)
Patch by Ronald S. Bultje % rbultje A ronald P bitfreak P net %
Original thread:...

8f42f523 01/28/2007 02:38 AM Ronald S. Bultje

proper error handling in file size retrieval, patch by Ronald S. Bultje rbultje at ronald bitfreak net

Originally committed as revision 7736 to svn://svn.ffmpeg.org/ffmpeg/trunk

1ae2c5f2 01/01/2007 09:49 PM Michael Niedermayer

fix indention of previous commit

Originally committed as revision 7396 to svn://svn.ffmpeg.org/ffmpeg/trunk

8e287af0 01/01/2007 09:49 PM Michael Niedermayer

seekless filesize retrieving support in 7 lines of code, also doesnt break compatibility

Originally committed as revision 7395 to svn://svn.ffmpeg.org/ffmpeg/trunk

3b61ab0b 12/16/2006 08:40 PM Aurelien Jacobs

put_*() are not only useful to muxers and protocol
fix compilation of matroska demuxer with --disable-muxers --disable-protocols

Originally committed as revision 7323 to svn://svn.ffmpeg.org/ffmpeg/trunk