Commit Graph

103 Commits

Author SHA1 Message Date
Anton Khirnov dccbd97d72 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 <mans@mansr.com>
2011-01-21 20:21:51 +00:00
Anton Khirnov 4efd5cf34b avio: add av_put_str and deprecate put_strz in favor of it
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-01-21 20:21:03 +00:00
Martin Storsjö c66f53cf8b Revert aviobuf: Retry if the read/write function returns AVERROR(EAGAIN)
This reverts SVN commit 26318, which broke MS-RTSP playback.

Originally committed as revision 26326 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-13 06:22:43 +00:00
Martin Storsjö a6963f8304 aviobuf: Retry if the read/write function returns AVERROR(EAGAIN)
Originally committed as revision 26318 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-12 07:06:27 +00:00
Anssi Hannula 17ee8f669f 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
2011-01-02 10:45:07 +00:00
Aurelien Jacobs 364cacc7c7 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
2010-08-19 21:28:43 +00:00
Reimar Döffinger 853a0fccce Cosmetics: fix indentation and remove a useless else.
Originally committed as revision 24495 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-25 14:35:12 +00:00
Reimar Döffinger 3aa13da970 Simplify get_byte and url_fgetc.
Originally committed as revision 24494 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-25 14:33:40 +00:00
Martin Storsjö 496c645d3b 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
demuxers fail to do short seeks backwards (if the input isn't seekable).

Originally committed as revision 24478 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-24 09:04:44 +00:00
Aurelien Jacobs a43416a540 improve ff_get_line to return line length
Originally committed as revision 24400 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-21 21:40:10 +00:00
Aurelien Jacobs 7c89295145 move ff_get_line to aviobuf.c
Originally committed as revision 24399 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-21 21:39:01 +00:00
Martin Storsjö aff4137d5f Remove an assert that was no longer correct nor relevant
Originally committed as revision 24344 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-20 09:58:30 +00:00
Martin Storsjö 7939d0edce 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
2010-07-17 05:26:30 +00:00
Martin Storsjö d5e9ddeb73 url_fskip: Return an error code if the url_fseek failed
Originally committed as revision 24277 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-16 23:20:03 +00:00
Michael Chinen 603e5c0b71 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
2010-07-09 12:14:33 +00:00
Eli Friedman 6fa197e277 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
2010-07-05 09:11:45 +00:00
Josh Allmann de1807bbc4 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
2010-07-01 20:15:49 +00:00
Stefano Sabatini 9d30e0682a Do not initialize res in url_fseek(), in the case !s->seek directly
return AVERROR(EPIPE) rather than the pre-defined value of res.

Slightly improve readability.

Originally committed as revision 22939 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-21 21:19:25 +00:00
Stefano Sabatini 4c4ef3db4b Make url_fsize() return AVERROR(ENOSYS) rather than AVERROR(EPIPE) if
the seek operation is not defined in the ByteIOContext.

Originally committed as revision 22902 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-18 17:37:21 +00:00
Howard Chu c007c687c9 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
2010-04-12 15:03:30 +00:00
Tomas Härdin 7a6fe01f99 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
2010-04-08 09:47:32 +00:00
Tomas Härdin 01d91b9be9 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
2010-04-08 09:02:27 +00:00
Tomas Härdin c6a5e087cf 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
2010-03-24 10:41:58 +00:00
Stefano Sabatini 8d5e638f04 Make url_fseek() return AVERROR_EOF rather than AVERROR(EPIPE) if end
of file is reached.

Originally committed as revision 22590 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-18 00:22:58 +00:00
Michael Niedermayer 493f54ada0 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
2010-03-15 22:54:22 +00:00
Stefano Sabatini 8757dc5e40 Remove duplicated empty line.
Originally committed as revision 21553 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-30 20:18:55 +00:00
Benoit Fouet 08580cb05a 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
2009-10-20 06:40:01 +00:00
Reimar Döffinger 90aa6ace63 Merge declaration and initialization
Originally committed as revision 20214 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-12 16:38:08 +00:00
Reimar Döffinger 098d8e0950 Simplify: use FFMIN
Originally committed as revision 20213 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-12 16:36:48 +00:00
Reimar Döffinger 7f7686dfb1 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
2009-10-02 06:36:39 +00:00
Baptiste Coudurier b3eab9fb64 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
2009-04-13 04:02:51 +00:00
Reimar Döffinger 0c5a43d648 Merge declaration and initialization of io_buffer_size
Originally committed as revision 16639 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-16 16:39:17 +00:00
Reimar Döffinger 2bdaf78c52 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
2009-01-16 16:37:54 +00:00
Reimar Döffinger 0e7ceb2442 Return AVERROR(ENOMEM) instead of -1 when malloc fails in url_open_dyn_buf_internal
Originally committed as revision 16636 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-16 15:35:51 +00:00
Reimar Döffinger aa805f94c5 Use AV_WB32 instead of reimplementing it.
Originally committed as revision 16635 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-16 15:34:37 +00:00
Reimar Döffinger dc2c2eea41 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
2009-01-16 15:32:33 +00:00
Reimar Döffinger 7ce820efa0 Replace nonsense -1234 return value in dyn_buf_write by proper AVERROR(ENOMEM)
Originally committed as revision 16633 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-16 15:30:52 +00:00
Aurelien Jacobs b250f9c66d 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
2009-01-13 23:44:16 +00:00
Aurelien Jacobs 9daa4ceaa3 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
2008-12-22 11:23:00 +00:00
Diego Biurrun 7f37f5687d whitespace cosmetics
Originally committed as revision 16100 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-12-13 13:39:13 +00:00
Jindřich Makovička f5edd874fa 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
2008-11-10 21:41:35 +00:00
Michael Niedermayer 4589dc5c4d 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
2008-10-18 17:30:37 +00:00
Reimar Döffinger 6bc03a695b 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
2008-10-04 21:11:58 +00:00
Diego Biurrun bc5c918ea8 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
2008-10-03 10:16:29 +00:00
Baptiste Coudurier 39a127bfbc Only reset buffer state if seeking is successful; update seek reg ref.
Originally committed as revision 14491 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-07-31 19:40:06 +00:00
Diego Biurrun 245976da2a Use full path for #includes from another directory.
Originally committed as revision 13098 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-05-09 11:56:36 +00:00
Aurelien Jacobs 3abe5fbdc4 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
2008-01-04 23:09:58 +00:00
Reimar Döffinger 1e0f346896 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
2007-12-22 16:18:07 +00:00
Michael Niedermayer b075e52059 Make recently added and still unused read_seek functions return offset_t.
Originally committed as revision 11274 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-12-19 21:11:08 +00:00
Michael Niedermayer 502bdf6893 Merge recently added and still unused play and pause functions.
Originally committed as revision 11273 to svn://svn.ffmpeg.org/ffmpeg/trunk
2007-12-19 20:57:13 +00:00