Commit Graph

169 Commits

Author SHA1 Message Date
Alexandra Hájková 93f16f338f asfdec: close the demuxer properly when read_header is failing
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-22 12:11:46 +02:00
Alexandra Hájková 5655236a67 asfdec: factor out seeking to the Data Object outside while
return INVALIDDARA if Data Object was not found

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-22 12:11:46 +02:00
Alexandra Hájková e61f39849c asfdec: make nb_sub to be unsigned int
number of subpayloads should be always positive

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-19 09:20:01 +02:00
Alexandra Hájková 2883ef34b5 asfdec: read the replicated data in a separate function
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-19 09:18:27 +02:00
Alexandra Hájková 0989d3ad1f asfdec: convert condition for the replicated data reading to be safer
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-19 09:16:28 +02:00
Alexandra Hájková 406627287e asfdec: do not read replicated data when their length is 0
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-19 08:59:48 +02:00
Alexandra Hájková c571424c7f asfdec: prevent memory leaks found with Coverity Scan
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-07-13 20:27:34 +02:00
Hendrik Leppkes 796268654c asfdec: always reset packet state after seeking
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-07-12 13:24:23 +02:00
Luca Barbato d80811c94e riff: Use the correct logging context 2015-07-11 18:45:44 +02:00
Alexandra Hájková 872fab4a3d asfdec: Fix reading from the pipe
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-07-10 13:25:02 +02:00
Alexandra Hájková 016cac75c6 asfdec: prevent the infinite loop in detect unknown_subobject
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-07-03 01:50:09 +02:00
Alexandra Hájková 9752d2e6cc asfdec: prevent possible memory leak in the asf_read_metadata_obj
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-07-03 01:50:09 +02:00
Luca Barbato 5bdfc17189 asf: Do not skip data streams 2015-06-28 17:10:54 +02:00
Alexandra Hájková b08569a239 lavf: Replace the ASF demuxer
The old one is the result of the reverse engineering and guesswork.
The new one has been written following the now-available specification.

This work is part of Outreach Program for Women Summer 2014 activities
for the Libav project.

The fate references had to be changed because the old demuxer truncates
the last frame in some cases, the new one handles it properly.
The seek-test reference is changed because seeking works differently
in the new demuxer. When seeking, the packet is not read from the stream
directly, but it is rather constructed by the demuxer. That is why
position is -1 now in the reference.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-06-28 10:16:40 +02:00
Vittorio Giovara 1a3eb042c7 Replace av_dlog with normal av_log at trace level
This applies to every library where performance is not critical.
2015-04-19 12:41:59 +01:00
Vittorio Giovara 0af3b65880 asf: do not export XMP metadata by default
Similarly to what has been done for MOV, display XMP metadata only when
users explicitly require it.

The Extensible Metadata Platform tag can contain various kind of data
which are not strictly related to the video file, such as history of
edits and saves from the project file.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-03-03 15:30:52 +00:00
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