Commit Graph

116 Commits

Author SHA1 Message Date
Anton Khirnov
3b3bbdd3e6 lavf,lavd: replace av_new_stream->avformat_new_stream part I.
Trivial replacements with sed are done in this commit:
sed 's/av_new_stream(\([^)]*\), 0)/avformat_new_stream(\1, NULL)/'
2011-10-19 17:02:11 +02:00
Anton Khirnov
145f741e11 AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_* 2011-10-12 16:51:16 +02:00
Anton Khirnov
dfc2c4d900 lavf: use designated initialisers for all (de)muxers.
It's more readable and less prone to breakage.
2011-07-17 06:58:37 +02:00
Anton Khirnov
6270995667 wav: remove a use of deprecated AV_METADATA_ macro 2011-07-17 06:58:29 +02:00
Tomas Härdin
b21e6b707f wav: parse 'bext' metadata
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-07-13 11:57:51 +02:00
Tomas Härdin
67b1761fcb wav: keep parsing until EOF if the input is seekable and we know the size of the data tag
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-07-13 11:57:51 +02:00
Tomas Härdin
90f2ee8cb4 wav: Refactor the tag checking into a switch statement
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-07-13 11:57:51 +02:00
Tomas Härdin
1cf18de982 wav: make sure neither data_size nor sample_count is negative.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-07-13 11:57:51 +02:00
Tomas Härdin
7f84055e2d wav: refactor the 'fmt ' tag search and parsing.
Moving the search and parsing of the 'fmt ' info the main loop of
wav_read_header() allows tags that precede it to be parsed.  Creating
wav_parse_fmt_tag() makes wav_read_header() easier to read.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-07-13 11:57:51 +02:00
Benjamin Larsson
a4ad943860 wav: add an option for writing BEXT chunk
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-07-13 11:57:47 +02:00
Mans Rullgard
0ebcdf5cda Do not include mathematics.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:06 +01:00
Carl Eugen Hoyos
8d0786ec6d wav: remove an invalid free().
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-13 20:47:06 +02:00
Max Horn
ca402f32e3 handle malloc failures in ff_get_wav_header
ff_get_wav_header is reading data from a WAVE file and then uses it
(without validation) to malloc a buffer. It then proceeded to read
data into the buffer, without verifying that the allocation succeeded.

To address this, change ff_get_wav_header to return an error if
allocation failed, and adapted all calling code to handle that error.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-04-14 13:56:09 +02:00
Anton Khirnov
8978fedaee avio: introduce an AVIOContext.seekable field
Use it instead of url_is_streamed and AVIOContext.is_streamed.
2011-04-03 22:46:40 +02:00
Mans Rullgard
2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Anton Khirnov
b7f2fdde74 avio: rename put_flush_packet -> avio_flush
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-16 22:59:39 -04:00
Anton Khirnov
45a8a02a41 lavf: replace avio_seek(SEEK_CUR) with avio_skip where it makes sense
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-16 22:24:51 -04:00
Anton Khirnov
66e5b1df36 avio: deprecate url_feof
AVIOContext.eof_reached should be used directly instead.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-07 17:20:31 -05:00
Anton Khirnov
a2704c9712 avio: add avio_tell macro as a replacement for url_ftell
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-04 11:26:57 -05:00
Anton Khirnov
e356fc57a2 lavf: replace all uses of url_fskip with avio_seek
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-01 12:22:16 -05:00
Anton Khirnov
6b4aa5dac8 avio: avio_ prefix for url_fseek
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-01 12:12:33 -05:00
Anton Khirnov
0abdb29317 lavf: use a new ffio_wfourcc macro instead of put_tag() where possible
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-25 14:38:22 -05:00
Anton Khirnov
77eb5504d3 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 <rsbultje@gmail.com>
2011-02-21 14:25:15 -05:00
Anton Khirnov
b7effd4e83 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
something useful.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-21 11:23:22 -05:00
Anton Khirnov
ae628ec1fd avio: rename ByteIOContext to AVIOContext.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-20 08:37:15 -05:00
Diego Elio Pettenò
c6610a216e Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.
This also lists the objects from those two libraries as internal (by adding
the ff_ prefix) so that they can then be hidden via linker scripts.
2011-01-26 22:10:09 +00:00
Michael Niedermayer
f9329946d0 Parse fact chunks from wav files to find duration.
Originally committed as revision 26370 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-15 17:13:32 +00:00
Michael Niedermayer
724b1f6a05 Factor tag reading code out of wav read_header()
Originally committed as revision 26369 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-15 17:13:30 +00:00
Michael Niedermayer
462b26202b Set duration for wav files from sample size and data size or the wf64 sample value.
This should improve duration accuracy slightly and avoids a warning about its
inaccuracy when accurate values are available. Idea by Frank Barchard

Originally committed as revision 26366 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-15 16:26:42 +00:00
Aurelien Jacobs
e94204dfd8 move pcm demuxers to their own file
Originally committed as revision 24993 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-30 21:17:34 +00:00
Baptiste Coudurier
f0187d20d1 In wav muxer, always flush in write_trailer, fix pipe output
Originally committed as revision 24568 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-28 08:17:02 +00:00
Daniel Verkamp
f45a27dc52 Reindent
Originally committed as revision 21747 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-02-10 20:27:53 +00:00
Daniel Verkamp
b7e0f88f2b Fix demuxing of wav files with broken data header
Originally committed as revision 21746 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-02-10 20:26:47 +00:00
Daniel Verkamp
70d8c762d9 Reindent
Originally committed as revision 20182 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-06 17:51:28 +00:00
Daniel Verkamp
811e0fc2e8 Add RF64 support to wav demuxer.
Originally committed as revision 20181 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-06 17:50:10 +00:00
Reimar Döffinger
3fcb5113c6 wav demuxer: return AVERROR_EOF instead of AVERROR(EIO) when the end of
the file is reached normally, without any error.

Originally committed as revision 20143 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-02 07:27:08 +00:00
Reimar Döffinger
e581b6288f wav: return av_get_packet errors unchanged.
Originally committed as revision 20142 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-02 07:22:44 +00:00
Reimar Döffinger
fbc6630168 Remove url_feof check that would be triggered only after incorrectly producing
an empty packet and also av_get_packet already handles EOF now.

Originally committed as revision 20140 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-02 07:05:52 +00:00
Reimar Döffinger
8a62a378de Remove useless setting of pkt->size, av_get_packet already handles that.
Originally committed as revision 20139 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-10-02 07:03:04 +00:00
Diego Biurrun
8f771e76fd Rearrange wav_muxer and {wav|w64}_demuxer blocks to be under proper #ifdefs.
Fixes compilation with --disable-optimizations --disable-demuxers.

Originally committed as revision 19961 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-22 11:19:36 +00:00
Diego Biurrun
738914be66 Move find_guid function and guid_data array to a globally available place.
Fixes compilation with --disable-optimizations --disable-demuxer=w64.

Originally committed as revision 19959 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-09-22 10:31:29 +00:00
Diego Biurrun
c5e86106fb cosmetics: whitespace, prettyprinting, coding style fixes
Originally committed as revision 19618 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-08-10 16:35:36 +00:00
Daniel Verkamp
740e89cf83 Sony Wave64 demuxer
patch by Daniel Verkamp, daniel drv nu

Originally committed as revision 19617 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-08-10 16:27:33 +00:00
Daniel Verkamp
1a40491ef2 Add ff_ prefixes to exported symbols in libavformat/riff.h.
patch by Daniel Verkamp, aniel drv nu

Originally committed as revision 19254 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-06-22 23:09:34 +00:00
Baptiste Coudurier
502d6c0a23 Change find_tag return type to int64_t, fix a bug
where size is negative and url_fseek then seek backward
causing infinite loop. This also support 4gb unsigned size.

Originally committed as revision 19083 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-06-03 22:36:59 +00:00
Diego Biurrun
406792e7b0 cosmetics: Remove pointless period after copyright statement non-sentences.
Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-19 15:46:40 +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
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
Michael Niedermayer
f2d65a6c8a Avoid segfault due to not set AVCodec.
Originally committed as revision 15400 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-09-24 17:46:23 +00:00
Justin Ruggles
5165651cf9 add error message for unsupported codecs in WAVE.
Resolves issue 623.

Originally committed as revision 15322 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-09-14 17:29:34 +00:00