Commit Graph

54 Commits

Author SHA1 Message Date
Vittorio Giovara c0bba95c23 wtv: fix variable sign in format 2013-11-03 11:51:40 +01:00
Luca Barbato 2b72f8ac32 wtv: Seek by sector properly
Use an helper function to seek by sector to avoid possible mistakes
due shifting by WTV_SECTOR_BITS a 32bit integer.

Contrary to common intuition, a 32 bit integer left shifted
by a 64 bit integer does not promote the 32 bit integer to
64 bit before shifting.
2013-10-18 15:08:18 +02:00
Martin Storsjö 83c285f880 wtv: Add more sanity checks for a length read from the file
Also make sure the existing length check can't overflow.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:46:35 +03:00
Martin Storsjö 979e9e8f36 wtv: Drop some casts that now are unnecessary
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-26 23:05:18 +03:00
Martin Storsjö 86f042dcab wtv: Make WTV_SECTOR_BITS a 64 bit constant
This makes sure that values that are left-shifted by this constant
end up casted to 64 bit before shifting, avoiding overflow if the
value ends up larger than 2 GB.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-26 23:05:14 +03:00
Luca Barbato f5e646a00a wtv: Mark attachment with a negative stream id
A sid 0 would be mismatched to the attachment.

Prevent NULL pointer dereference.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-07-07 04:28:51 +02:00
Peter Ross e544782623 riff: Move guid structs and helper functions into riff
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-04-21 18:20:30 +02:00
Diego Biurrun 511cf612ac miscellaneous typo fixes 2012-12-21 00:18:34 +01:00
Justin Ruggles 935fbb66ef wtv: set channel layout for mpeg audio 2012-11-12 10:33:23 -05:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Martin Storsjö dc53858063 wtv: Check the return value from gmtime
On MSVC, gmtime returns NULL for values outside of their supported
range (and these show up in our fate test). This doesn't seem
to affect the actual fate test result.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-25 16:20:08 +03:00
Anton Khirnov 6e9651d106 lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Janne Grunau 68e252f548 wtv: fix memleaks during normal operation 2012-01-11 01:34:30 +01:00
Mans Rullgard 3383a53e7d lavu: replace int/float punning functions
The existing functions defined in intfloat_readwrite.[ch] are
both slow and incorrect (infinities are not handled).

This introduces a new header with fast, inline conversion
functions using direct union punning assuming an IEEE-754
system, an assumption already made throughout the code.

The one use of Intel/Motorola extended 80-bit format is
replaced by simpler code sufficient under the present
constraints (positive normal values).

The old functions are marked deprecated and retained for
compatibility.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-12-11 18:47:19 +00:00
Anton Khirnov c3f9ebf743 lavf: make av_set_pts_info private.
It's supposed to be called only from (de)muxers.
2011-11-30 20:34:45 +01:00
Martin Storsjö 3607ed70d5 Remove leftover includes of strings.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-06 11:53:05 +02:00
Alex Converse 4682a1dc3a mpegts: Add support for Sections in PMT 2011-10-28 14:54:14 -07:00
Alex Converse c3bc6096f2 mpegts: Add support for multiple mp4 descriptors 2011-10-28 14:54:13 -07:00
Anton Khirnov 84ad31ff18 lavf: replace av_new_stream->avformat_new_stream part II.
Manual replacements are done in this commit.

In many cases, the id is some constant made up number (e.g. 0 for video
and 1 for audio), which is then not used in the demuxer for anything.
Those ids are removed.
2011-10-19 17:02:11 +02:00
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
Diego Biurrun 24c9babaaf doxygen: Fix parameter names to match the function prototypes. 2011-07-03 18:30:02 +02:00
Anton Khirnov d2d67e424f Remove all uses of now deprecated metadata functions. 2011-06-08 07:43:45 +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 f5b386afab Reemove remaining uses of deprecated AVERROR_NOTSUPP. 2011-04-06 14:10:08 +02:00
Anton Khirnov e42500cb4f lavf: replace some more avio_seek(SEEK_CUR) with avio_skip
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-20 20:33:05 -04: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 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 3e68b3ba7b avio: deprecate url_ferror
AVIOContext.error should be used directly instead.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-15 08:04:28 -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 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 8d9ac969cb avio: rename av_alloc_put_byte -> avio_alloc_context for consistency
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-21 10:23:44 -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
Peter Ross 1a973feb45 wtv: ignore empty data_guid chunks
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-13 16:49:39 -05:00
Peter Ross 68137ba386 wtv: mark streams intended for hearing or visual impaired persons
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-02-10 22:55:17 +01:00
Peter Ross 74571e333c reindent after last commit
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-05 20:10:32 -05:00
Peter Ross e4f85b8499 wtv: do not use flag in stream_guid chunk to determine if stream is valid, as this method is unreliable
This fixes roundup issue 2556.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-05 20:09:56 -05:00
Peter Ross e6fb5a4f78 add ff_index_search_timestamp and ff_add_index_entry
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-03 21:50:54 -05:00
Peter Ross f61dee2fe4 wtv: filesystem implementation
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-03 20:55:42 -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
Peter Ross b070bcfe8a wtv: ignore VIDEOINFOHEADER2 picture aspect ratio information, as it is unreliable
Originally committed as revision 26327 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-14 08:28:27 +00:00
Peter Ross 5a477e5960 fix indentation
Originally committed as revision 26278 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-09 02:44:54 +00:00
Peter Ross 866009ea19 wtv: only process timestamp_guid chunks for streams that we know about
Originally committed as revision 26277 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-09 02:42:16 +00:00
Peter Ross a5a36a7970 wtv: do not repopulate codec information after we have seen data chunks
Originally committed as revision 26276 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-09 02:35:06 +00:00
Peter Ross bf2e54174e wtv: stop processing chunks if length is smaller than chunk header
Originally committed as revision 26275 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-09 02:21:30 +00:00
Peter Ross 9372f31e03 wtv: fix typo
Originally committed as revision 26274 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-09 02:13:58 +00:00
Peter Ross 6780f48846 wtv: obtain codec information from stream2_guid chunks, if present
Originally committed as revision 26208 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-04 11:38:29 +00:00
Peter Ross 17e33f662a wtv: display warning if scrambled stream is detected
Originally committed as revision 26197 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-02 11:17:34 +00:00