Commit Graph

203 Commits

Author SHA1 Message Date
Diego Biurrun
daf8cf358a avformat: Don't anonymously typedef structs 2015-02-14 10:13:47 -08:00
wm4
9deaec7828 lavf: move internal fields from public to internal context
This is not an API change; the fields were explicitly declared private
before.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-02-10 21:45:04 +01:00
Diego Biurrun
d92024f18f lavf: more correct printf format specifiers 2014-03-11 13:13:41 +01:00
Janne Grunau
f5d92d9cab asfdec: fix seeking with fragmented packets
After seeking fragments with an offset > 0 must be skipped to correctly
assemble packets.

Bug-Id: 43
2014-02-12 12:52:28 +01:00
Andrew Kelley
0c08256596 asfdec: short-circuit seeking to the start of stream
Bug-id: 43

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2014-02-12 12:52:28 +01:00
Janne Grunau
0ebb523f07 asfdec: check ff_get_guid() return values during seeking
Hitting EOF during seeking is quite likely. Fixes use of uninitialized
data during fate-seek-lavf-asf.
2014-02-12 12:52:28 +01:00
Martin Storsjö
cc41167aed asfdec: Check the return value of asf_read_stream_properties
This makes sure errors in setting stream parameters are passed
on to the caller. This avoids successfully opening files while
some parameters aren't filled in properly.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-30 10:48:58 +03:00
Vladimir Pantelic
5f40833360 asfdec: substract preroll time from marker presentation time
this was forgotten when we changed ASF to not output the preroll time

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-19 19:37:28 +02:00
Diego Biurrun
7950e519bb Disable deprecation warnings for cases where a replacement is available 2013-08-02 19:19:02 +02:00
Diego Biurrun
2832ea26f3 Remove commented-out debug #define cruft 2013-05-16 00:23:30 +02:00
Diego Biurrun
e926b5ceb1 avformat: Drop unnecessary ff_ name prefixes from static functions 2013-04-30 16:16:23 +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
Anton Khirnov
1afddbe59e avpacket: use AVBuffer to allow refcounting the packets.
This will allow us to avoid copying the packets in many cases.

This breaks ABI.
2013-03-08 07:33:45 +01:00
Anton Khirnov
1ef0e8a6bf asfdec: do not assume every AVStream has a corresponding ASFStream
This won't be true for ID3 attached picture.

Also stop allocating now useless dummy ASFStreams for ASF native
attached pictures.
2013-02-09 18:57:21 +01:00
Vladimir Pantelic
f5fac6f777 asfdec: support reading ID3v2 tags in ASF files
Yes, these files do exist

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Vladimir Pantelic
84b721db36 asfdec: also read Metadata Library Object
In some ASF files this objects holds cover art and other tags. Compared to
Metadata Object it can also hold GUIDs, but we ignore these for now.

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Vladimir Pantelic
61f9ad2dfc asfdec: read the full Metadata Object, not just aspect ratio information
Use the same get_tag()/get_value() as for the Extended Content Description
but handle the 16 bit vs 32 bit difference for type 2 (BOOL)

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Vladimir Pantelic
36fab50e90 asfdec: silence a warning
Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Diego Biurrun
48a4ffa722 asf: K&R formatting cosmetics 2013-02-06 09:48:51 +01:00
Diego Biurrun
e817d9139f asfdec: Fix printf format string length modifier 2013-01-07 09:21:42 +01:00
Anton Khirnov
292a08cbab asfdec: cosmetics, reformat ff_asf_parse_packet() 2012-10-24 08:46:45 +02:00
Diego Biurrun
72eaba5e4f avformat: Convert some commented-out printf/av_log instances to av_dlog 2012-10-01 10:24:28 +02:00
Diego Biurrun
11d4e92ed9 avformat: Remove non-compiling and/or silly commented-out printf/av_log statements 2012-10-01 10:24:28 +02:00
Martin Storsjö
e6153f173a avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:44 +03:00
Anton Khirnov
36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Diego Biurrun
0177b7d23a Improve descriptiveness of a number of codec and container long names 2012-07-30 20:46:55 +02:00
Anton Khirnov
5e745cefc0 asfdec: read attached pictures. 2012-07-02 16:16:45 +02:00
Martin Storsjö
75b7feaeb4 asfdec: Add an option for not searching for the packet markers
Some streams don't contain these.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-07 01:01:03 +03:00
Martin Storsjö
20234a4bd7 cosmetics: Align muxer/demuxer declarations
Also add missing trailing commas, break long codec_tag lines and
add spaces in codec_tag declarations.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-06 19:19:59 +03:00
Ronald S. Bultje
44257ef426 asf: only set index_read if the index contained entries.
This allows falling back to a binary search if the file contains no
index, thus fixing seeking in such files (e.g. luckynight.wma).
2012-03-28 10:22:25 -07:00
Ronald S. Bultje
e73c6aaabf asf: reset side data elements on packet copy.
Prevents crash (double free) when free()ing the original packet.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-22 12:17:14 -07:00
Justin Ruggles
bdbf1fa405 asfdec: Do not set AVCodecContext.frame_size 2012-02-29 15:45:50 -05:00
Ronald S. Bultje
bb6d5411e1 asf: don't seek back on EOF.
Seeking back on EOF will reset the EOF flag, causing us to re-enter
the loop to find the next marker in the ASF file, thus potentially
causing an infinite loop.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-28 16:25:05 -08:00
Ronald S. Bultje
6e57a02b9f asf: error out on ridiculously large minpktsize values.
They cause various issues further down in demuxing.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-28 14:32:34 -08:00
Ronald S. Bultje
41afac7f7a asf: prevent packet_size_left from going negative if hdrlen > pktlen.
This prevents failed assertions further down in the packet processing
where we require non-negative values for packet_size_left.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-18 09:12:32 -08:00
Diego Biurrun
6df5c528ca Move some conditionally used variables into the block where they are used.
This allows dropping the av_unused argument from them.
2012-02-13 19:20:54 +01:00
Anton Khirnov
6e9651d106 lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Justin Ruggles
e9dc920127 asfdec: add side data to ASFStream packet instead of output packet.
fixes memleak of side data
2011-12-21 17:52:31 -05:00
John Stebbins
b88eb87630 asf: use packet dts as approximation of pts
Having a somehow off seeking is better than having none at all.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-12-02 11:11:47 +01:00
Luca Barbato
73f027c17b asf: do not call av_read_frame
The asf_read_pts should read the bitstream directly.
2011-12-02 11:11:47 +01: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
Diego Biurrun
2f5df0b12c Replace ffmpeg references with more accurate libav* references. 2011-11-02 10:42:55 +01:00
Anton Khirnov
a2faa95151 lavf: make some seeking functions private
Specifically av_update_cur_dts(), av_seek_frame_binary() and
av_gen_search().

They are not supposed to be called outside lavf.
2011-10-28 09:23:24 +02:00
Anton Khirnov
1fa395e471 lavf: use avpriv_ prefix for ff_new_chapter().
It's used in libavdevice.
2011-10-20 20:57:23 +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
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
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
Mans Rullgard
add41decd9 Remove return statements following infinite loops without break
These statements cannot be reached and are thus not needed.
This removes a number of compiler warnings.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:39:07 +01:00
Diego Biurrun
91c9aa0941 Move some conditionally used code below the appropriate #ifdef. 2011-07-03 18:30:01 +02:00
Anton Khirnov
d2d67e424f Remove all uses of now deprecated metadata functions. 2011-06-08 07:43:45 +02:00
Mans Rullgard
e65ab9d94f Remove unused variables 2011-06-02 20:06:00 +01:00
Mans Rullgard
b122c65107 asfdec: add missing #include for av_bswap32()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-19 12:38:43 +01:00
Uoti Urpala
29fa570d0c asfdec: fix possible overread on broken files. 2011-05-17 22:06:00 +02:00
Vladimir Pantelic
69fa23961e asfdec: do not fall back to binary/generic search
asf_read_seek() inside the asf demuxer already does the
right thing, it tries the index and if that fails it uses
binary search. If binary search is called from outside of asfdec.c
it will fail because the asf code cannot clean up after itself.
Therefore introduce AVFMT_NOBINSEARCH that prevents the seek
code to fallback to binary search and AVFMT_NOGENSEARCH that
prevents the seek code to fallback to generic search.
2011-05-17 22:06:00 +02:00
Vladimir Pantelic
b58bc17cf7 asfdec: reindent after previous commit c7bd5ed 2011-05-17 22:05:22 +02:00
Vladimir Pantelic
c7bd5edae4 asfdec: fallback to binary search internally
lavf will do that anyway in case seek by index fails
2011-05-17 21:48:16 +02:00
Uoti Urpala
0bd433a916 asfdec: fix assert failure on invalid files
Add an extra size validity check in asf_read_frame_header(). Without
this asf->packet_size_left may become negative, which triggers an
assertion failure later.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-03 22:36:08 -04:00
Ronald S. Bultje
f8b1245922 asfdec: fix parsing of packets that overrun into padding.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-03 22:14:04 -04:00
Vladimir Pantelic
8408e1d7d6 asf: remove commented out code in asf_read_seek
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-04-20 12:47:13 +01:00
Diego Biurrun
0b5ae1fdd3 asfdec: Remove dead code from asf_read_close(). 2011-04-18 15:35:45 +02:00
Kostya Shishkov
2d8591c27e make containers pass palette change in AVPacket
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-04-15 18:02:05 +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
ff1ec0c3f8 avio: undeprecate av_url_read_fseek/fpause under nicer names
It seems their replacements won't be ready anytime soon.
2011-04-12 19:17:05 +02:00
Anton Khirnov
acaceca2f1 asfdec: remove a forgotten declaration of nonexistent function 2011-04-08 07:08:12 +02:00
Vladimir Pantelic
4377fafda1 asfdec: also subtract preroll when reading simple index object
This was missed when ASF was changed to return timestamps
without preroll.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-23 13:46:19 +00:00
Anton Khirnov
933e90a69a avio: make av_url_read_fseek/fpause internal.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-03-21 14:54:52 -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
Vladimir Pantelic
de11ee906e asfdec: subtract the preroll value and thus output 0 based timestamps
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-17 16:25:54 +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
ae628ec1fd avio: rename ByteIOContext to AVIOContext.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-20 08:37:15 -05:00
Mans Rullgard
aabc2682fc asfdec: fix build for big endian targets
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-13 22:10:45 +00:00
Anton Khirnov
5cbd3b5d91 asfdec: don't export empty metadata
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-13 16:49:39 -05:00
Anton Khirnov
8bf6db1b29 asfdec: split reading stream properties out of asf_read_header()
This contains a rename from gsize->size

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-13 16:49:39 -05:00
Anton Khirnov
0b1d291a71 asfdec: deobfuscate reading video properties size
This code will be later split out into a function which takes a 'size'
argument, so I'm keeping the name 'sizeX' here.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-10 18:05:01 -05:00
Anton Khirnov
c1fea23070 asfdec: split asf_read_header()
Only trivial splits are done here -- i.e. copy/paste + reindent +
missing variable declarations.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-10 18:03:32 -05:00
Anton Khirnov
d7a5106eb2 asfdec: skip the stream bitrate list
Its contents aren't used for anything.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-10 07:03:49 -05:00
Anton Khirnov
7c7253802b asfdec: use an ASFContext array for storing stream bitrates
This will be useful for splitting asf_read_header()

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-09 22:26:03 -05:00
Anton Khirnov
d42b09723e asfdec: move DAR list to ASFContext
This will be useful for splitting asf_read_header()

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-09 22:26:00 -05:00
Anton Khirnov
569ff02168 asfdec: remove some write-only values from the context
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-09 22:41:30 +00:00
Anton Khirnov
4bc328a2bd asf: split ASFContext into muxer and demuxer parts.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-09 15:31:09 -05:00
Anton Khirnov
e4e234fad7 asf: make ff_guidcmp inline and move it to asf.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-02-09 12:33:05 +00:00
Luca Barbato
dfd2a005eb Replace dprintf with av_dlog
dprintf clashes with POSIX.1-2008
2011-01-29 23:55:37 +01:00
Anton Khirnov
042950542d asfdec: ensure that the whole tag is read.
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-01-28 21:33:45 +01: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
Anton Khirnov
2934cd9dbf asfdec: remove some commented-out cruft
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-01-25 21:48:03 +01:00
Anton Khirnov
93b78d1210 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 <janne-ffmpeg@jannau.net>
2011-01-25 21:48:03 +01:00
Peter Ross
a750050f4c make guid utility function visibile to other modules (ff_guidcmp, ff_get_guid)
Originally committed as revision 26093 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-26 01:26:29 +00:00
Reimar Döffinger
bf09a01981 Change ASF demuxer to return incomplete last packets.
Whether the behaviour for streams using scrambling makes sense
is unclear.

Originally committed as revision 26053 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-18 13:18:52 +00:00
Reimar Döffinger
4172951ba7 Return an error when get_buffer reads none or only partial data instead
of returning packets with uninitialized data.
Returning partial packets as for other demuxers is problematice due to
packet scrambling and thus is not done.

Originally committed as revision 25931 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-11 21:41:47 +00:00
Reimar Döffinger
3c3ef81b9b Ensure that packets returned from ASF demuxer are properly 0-padded.
Originally committed as revision 25930 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-11 21:39:08 +00:00
Stefan Gehrer
77b7c334be skip top-level objects to search for the simple index in ASF files
Originally committed as revision 25863 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-12-03 07:49:07 +00:00
Anton Khirnov
ad7768f4c4 add ff_ prefix to metadata_conv()
patch by Anton Khirnov  anton _at_ khirnov _dot_ net

Originally committed as revision 25505 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-16 13:20:41 +00:00
Anton Khirnov
03700d399b Export metadata in the generic format. Deprecate old conversion API.
patch by Anton Khirnov  anton _at_ khirnov _dot_ net

Originally committed as revision 25493 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-15 19:04:25 +00:00
Stefano Sabatini
b9f9e59afc Replace deprecated CODEC_TYPE_AUDIO and CODEC_TYPE_VIDEO with the
corresponding AVMEDIA_TYPE_* symbols.

Originally committed as revision 25201 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-25 23:27:16 +00:00