summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
Commit message (Collapse)AuthorAge
* Mark read-only tables as staticDiego Biurrun2016-05-05
|
* matroska: Support interlaced content correctlyLuca Barbato2016-03-31
| | | | The matroska specification now has two elements for it.
* matroska: Support V_QUICKTIME as written in the specificationLuca Barbato2016-03-15
| | | | | | | | | | | | Check if the size is written the first 4 bytes and read the next 4 as fourcc candidate, fallback checking the initial for 4 bytes. "The CodecPrivate contains all additional data that is stored in the 'stsd' (sample description) atom in the QuickTime file after the mandatory video descriptor structure (starting with the size and FourCC fields)" CC: libav-stable@libav.org
* lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* mkv: Force the full parsing of mp3Luca Barbato2016-02-19
| | | | | | | Some muxer might or might not fit incomplete mp3 frames in their packets. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* matroskadec: Fix sample_aspect_ratio for stereo matroska contentAaron Colwell2015-12-07
| | | | | | | | | matroskaenc applies divisors to the display width/height when generating stereo content. This patch adds the corresponding multipliers to matroskadec so that the original sample aspect ratio can be recovered. Signed-off-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* matroska: Warn when metadata references a non-existent elementLuca Barbato2015-11-28
| | | | | | Avoid some confusion when the information is not present. Bug-Id: 902
* avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-26
| | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
* lavc: Make AVPacket.duration int64, and deprecate convergence_durationwm42015-09-29
| | | | | | | | | Note that convergence_duration had another meaning, one which was in practice never used. The only real use for it was a 64 bit replacement for the duration field. It's better just to make duration 64 bits, and to get rid of it. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* riff: Use the correct logging contextLuca Barbato2015-07-11
|
* mkv: Print unsupported mov tags when foundVittorio Giovara2015-05-12
|
* matroskadec: fix crash when parsing invalid mkvThomas Guillem2015-04-18
| | | | | | CC: libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* matroskadec: export cover art correctlywm42015-04-08
| | | | | | | | | | | | | | | | | | Generally, libavformat exports cover art pictures as video streams with 1 packet and AV_DISPOSITION_ATTACHED_PIC set. Only matroskadec exported it as attachment with codec_id set to AV_CODEC_ID_MJPEG. Obviously, this should be consistent, so change the Matroska demuxer to export a AV_DISPOSITION_ATTACHED_PIC pseudo video stream. Matroska muxing is probably incorrect too. I know that it can create broken files with an audio track and just 1 video frame when e.g. remuxing mp3 with APIC to mkv. But for now this commit does not change anything about muxing, and also continues to write attachments with AV_CODEC_ID_MJPEG should the muxer application have special knowledge that the Matroska is broken in this way. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* matroskadec: Check memory allocationsVittorio Giovara2015-03-12
| | | | CC: libav-stable@libav.org
* avformat: Don't anonymously typedef structsDiego Biurrun2015-02-14
|
* matroskadec: Fix read-after-free in matroska_read_seek()Xiaohan Wang2014-12-15
| | | | | | | | | | | In matroska_read_seek(), |tracks| is assigned at the begining of the function. However, functions like matroska_parse_cues() could reallocate the tracks and invalidate |tracks|. This assigns |tracks| only before using it, so that it will not get invalidated elsewhere. Bug-Id: chromium/427266
* matroskadec: check return valuesVittorio Giovara2014-10-24
| | | | | CC: libav-stable@libav.org Bug-Id: CID 733712
* matroskadec: fix leak on errorVittorio Giovara2014-10-24
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1026767
* matroskadec: parse stereo mode on decodingVittorio Giovara2014-08-28
| | | | | | | | | Convert the Matroska stereo format to the Stereo3D format, and add a Stereo3D side data to the stream. Bump the doctype version supported. Bug-Id: 728 / https://bugs.debian.org/757185
* matroska: list supported extensionsVittorio Giovara2014-08-28
|
* cosmetics: Write NULL pointer inequality checks more compactlyGabriel Dume2014-08-15
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-15
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* matroska: Register mime typesLuca Barbato2014-07-29
|
* matroskadec: Fix a double negation typoMichael Niedermayer2014-07-02
| | | | | | | | | This typo has existed since this code was added in c16582579. Newer versions of clang pointed out that this comparison always was true (since the result of the negation is either 0 or 1, while AVDISCARD_ALL has the value 48). Signed-off-by: Martin Storsjö <martin@martin.st>
* Replace av_malloc() and memset(0) by av_mallocz()Diego Biurrun2014-06-22
|
* matroskadec: parse the channel layout mask for FLACAnton Khirnov2014-05-28
| | | | It is commonly stored in a vorbiscomment block in codec private data.
* matroskadec: export just the STREAMINFO block as FLAC extradataAnton Khirnov2014-05-28
| | | | | It contains all information that is used by the decoder and the other FLAC-capable demuxers (flacdec, ogg) export only STREAMINFO as well.
* matroskadec: split parsing tracks into a separate functionAnton Khirnov2014-05-28
|
* matroskadec: read the CodecDelay elementAnton Khirnov2014-04-30
|
* lavf: more correct printf format specifiersDiego Biurrun2014-03-11
|
* matroskadec: cosmetics: Fix "attachement" vs. "attachment" typoDiego Biurrun2014-03-07
|
* matroskadec: K&R formatting cosmeticsKeiji Costantini2014-03-07
| | | | | | Also sort #includes into canonical order. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* matroskadec: use correct compression parameters for current track CodecPrivateAurelien Jacobs2013-11-21
| | | | | | Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* matroskadec: pad EBML_BIN data.Anton Khirnov2013-11-21
| | | | | | | | It might be passed to code requiring padding, such as lzo decompression. Fixes invalid reads. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org
* matroskadec: Support HEVC demuxingYusuke Nakamura2013-10-31
|
* matroskadec: check av_strdup() when setting defaultsAnton Khirnov2013-09-24
|
* matroskadec: Verify realaudio codec parametersMartin Storsjö2013-09-17
| | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat: Use av_reallocp_array() where suitableAlexandra Khirnova2013-09-10
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* matroskadec: Check that .lang was allocated and set before reading itMartin Storsjö2013-09-03
| | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* matroskadec: introduce resync function.Sean McGovern2013-06-10
| | | | | | | | | | This allows handling matroska files with errors. Fixes test4.mkv and test7.mkv from the official Matroska test suite, and by extension Bugzilla #62. Based on a patch by Reimar Doffinger <Reimar.Doeffinger@gmx.de> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* matroskadec: export full wavpack blocks.Anton Khirnov2013-05-28
| | | | | This allows us to get rid of demuxer-specific hacks in the decoder and will allow streamcopy from matroska once we have a wavpack muxer.
* matroskadec: silently skip CodecState element.Anton Khirnov2013-05-27
| | | | | mkvmerge apparrently uses it for mpeg1/2 video, but it contains the same information as CodecPrivate, so it can be ignored.
* avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriateDiego Biurrun2013-05-04
|
* matroska: pass the lace size to the matroska_parse_rm_audioLuca Barbato2013-04-03
| | | | | | | | | | | Each lace must be independent according to the specification. Fix heap-buffer-overflow in matroska_parse_block for corrupted real media in mkv files. Stricter check than fc43c19a567aa945398dccb491d972c11ec2a065 CC: libav-stable@libav.org
* matroska: fix a corner case in ebml-lace parsingLuca Barbato2013-04-03
| | | | | | Make sure we notice when the lace_size[n] is a negative value. CC: libav-stable@libav.org
* matroska: Update the available size after lace parsingDale Curtis2013-04-03
| | | | | | | | | Fix heap-buffer-overflow in matroska_parse_block for corrupted real media in mkv files. CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* matroskadec: request a read buffer for the wav headerLuca Barbato2013-03-12
| | | | | | Solve an infiniloop. CC: libav-stable@libav.org
* lavf: remove disabled FF_API_R_FRAME_RATE cruftAnton Khirnov2013-03-11
|
* avpacket: use AVBuffer to allow refcounting the packets.Anton Khirnov2013-03-08
| | | | | | This will allow us to avoid copying the packets in many cases. This breaks ABI.