summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
Commit message (Collapse)AuthorAge
* Merge commit '5f0226668124aa7ae4db501ba7f4ace4c770f3d1'Derek Buitenhuis2016-05-08
|\ | | | | | | | | | | | | * commit '5f0226668124aa7ae4db501ba7f4ace4c770f3d1': matroska: Support interlaced content correctly Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * 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
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * 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>
* | lavf/matroskadec: Add early support for some of the new colour elements.Neil Birkbeck2016-03-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding early support for a subset of the proposed colour elements according to the latest version of spec: https://mailarchive.ietf.org/arch/search/?email_list=cellar&gbt=1&index=hIKLhMdgTMTEwUTeA4ct38h0tmE I've left out elements for pix_fmt related things as there still seems to be some discussion around these, and the max_cll/max_fall are currently not propagated as there is not yet side data for them. The new elements are exposed under strict experimental mode. Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/matroskadec: Process QuickTime palette per trackMats Peterson2016-02-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/matroskadec: Get sample size from private dataMats Peterson2016-01-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/matroskadec: Use av_realloc() in get_qt_codec()Mats Peterson2016-01-12
| | | | | | | | | | | | | | Use av_realloc() rather than av_malloc() when normalizing noncompliant private data in get_qt_codec(). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/matroskadec: Normalize noncompliant A_QUICKTIME/V_QUICKTIME private dataMats Peterson2016-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new static function get_qt_codec() that takes care of the initial retrieval of the fourcc and codec ID for A_QUICKTIME and V_QUICKTIME. It also normalizes noncompliant private data found in some older files that incorrectly starts with the fourcc by expanding/shifting the data by 4 bytes, and storing the data size at the start. This is necessary in order for the rest of the code in the A_QUICKTIME and V_QUICKTIME blocks (and most likely other code as well) to correctly parse the private data. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/matroskadec: A_QUICKTIME and fourcc 0x00000000Mats Peterson2016-01-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In many older QuickTime files, the audio format, or "fourcc", is 0x00000000. The QuickTime File Format Specification states the following regarding this situation: "This format descriptor should not be used, but may be found in some files. Samples are assumed to be stored in either 'raw ' or 'twos' format, depending on the sample size field in the sound description." MPlayer handles this logic by itself, but FFmpeg/FFplay currently does not. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/matroskadec: correct codec_tag for "SMI" SVQ3 filesMats Peterson2016-01-06
| | | | | | | | | | | | This corrects the codec_tag for some SVQ3 files Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/matroskadec: palettized QuickTime video in MatroskaMats Peterson2015-12-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Palettized QuickTime video in Matroska has hitherto not been recognized whatsoever, and the "palette" used has been completely random. The patch for matroskadec.c fixes this issue by adding a palette side data packet in matroska_deliver_packet(), much in the same way as it's done in mov.c. Video samples for testing are available at https://drive.google.com/open?id=0B3_pEBoLs0faWElmM2FnLTZYNlk. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'febfb49a70e82f5ac46dc7ea34dabd4d56b19b31'Hendrik Leppkes2015-12-18
|\| | | | | | | | | | | | | * commit 'febfb49a70e82f5ac46dc7ea34dabd4d56b19b31': matroskadec: Fix sample_aspect_ratio for stereo matroska content Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * 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>
* | lavf/matroskadec: Set codec_tag also for audio codecs.Carl Eugen Hoyos2015-12-12
| | | | | | | | | | This was already done for "A_MS/ACM" mkv files and it is done for mov files but was not done for A_QUICKTIME" mkv files.
* | Merge commit 'a0fa6d06b848f26b16ba12f0a9a4a85b93ab8022'Hendrik Leppkes2015-12-07
|\| | | | | | | | | | | | | * commit 'a0fa6d06b848f26b16ba12f0a9a4a85b93ab8022': matroska: Warn when metadata references a non-existent element Merged-by: Hendrik Leppkes <h.leppkes@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
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | avformat/matroskadec: Fix sample_aspect_ratio for stereo matroska contentAaron Colwell2015-12-02
| | | | | | | | | | | | | | | | matroskaenc.c applies divisors to the display width/height when generating stereo content. This patch adds the corresponding multipliers to matroskadec.c so that the original sample aspect ratio can be recovered. Signed-off-by: wm4 <nfxjfg@googlemail.com>
* | avformat/matroskadec: Check subtitle stream before dereferencingMichael Niedermayer2015-11-17
| | | | | | | | | | | | | | | | Unrecognized streams are not allocated Fixes: flicker-1.color1.vp91447030769.08.webm Found-by: Chris Cunningham <chcunningham@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-27
| |
* | Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'Hendrik Leppkes2015-10-27
|\| | | | | | | | | | | | | * commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457': avpacket: Replace av_free_packet with av_packet_unref Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * 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`.
* | lavf/matroskadec: drop indexes that appear brokenRodger Combs2015-10-09
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d'Hendrik Leppkes2015-09-29
|\| | | | | | | | | | | | | * commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d': lavc: Make AVPacket.duration int64, and deprecate convergence_duration Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * 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>
* | lavf/matroska: ignore ChapCountry ID for nowRodger Combs2015-09-20
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/matroskadec: Fully parse and repack MP3 packetsRodger Combs2015-08-16
| | | | | | | | | | | | Fixes https://trac.ffmpeg.org/ticket/4776 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'd80811c94e068085aab797f9ba35790529126f85'Michael Niedermayer2015-07-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd80811c94e068085aab797f9ba35790529126f85': riff: Use the correct logging context Conflicts: libavformat/asfdec_o.c libavformat/avidec.c libavformat/dxa.c libavformat/matroskadec.c libavformat/mov.c libavformat/riff.h libavformat/riffdec.c libavformat/wavdec.c libavformat/wtvdec.c libavformat/xwma.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * riff: Use the correct logging contextLuca Barbato2015-07-11
| |
* | avformat/matroskadec: Fix undefined shift in read_sint()Michael Niedermayer2015-07-01
| | | | | | | | | | | | | | Fixes: asan_heap-oob_17212bc_2243_cov_594210248_h264_TTA.mkv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: validate audio channels and bitdepthAndreas Cadhalpun2015-06-16
| | | | | | | | | | | | | | | | | | In the TTA extradata re-construction the values are written with avio_wl16 and if they don't fit into uint16_t, this triggers an av_assert2 in avio_w8. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | matroskadec: check audio sample rateAndreas Cadhalpun2015-06-16
| | | | | | | | | | | | | | | | | | And default to 8000 if it is invalid. An invalid sample rate can trigger av_assert2 in av_rescale_rnd. Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | matroskadec: verify seekhead IDswm42015-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some files have SeekHead elements with broken IDs. They mismatch with the ID of the destination element. These files are written by "IDMmkvlib0.1" (as identified by the MuxingApp and WritingApp elements), and the SeekHead IDs are actually endian-swapped. This confuses the SeekHead logic of the demuxer. It will read some elements twice, because the SeekHead ID is used to identify and remember already read elements. With the file at hand, the stream list was duplicated by reading the Tracks element twice. Fix this by rejecting invalid EBML IDs in SeekHead entries. (This fix is relatively specific to the broken file at hand, and doesn't protect against some other cases of broken SeekHead, such as valid but mismatching target element IDs.) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '8fc11abe1fea4f211cc7dbd58a173d1221627d90'Michael Niedermayer2015-05-13
|\| | | | | | | | | | | | | | | | | | | * commit '8fc11abe1fea4f211cc7dbd58a173d1221627d90': mkv: Print unsupported mov tags when found Conflicts: libavformat/matroskadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mkv: Print unsupported mov tags when foundVittorio Giovara2015-05-12
| |
* | avformat/matroskadec: Cleanup error handling for bz2 & zlibMichael Niedermayer2015-05-12
| | | | | | | | | | | | Fixes CID703652 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Use size_t for the variable holding a strlen() value.Michael Niedermayer2015-05-11
| | | | | | | | | | | | Should make no difference but is more correct Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Use tracks[k]->stream instead of s->streams[k]Michael Niedermayer2015-05-04
| | | | | | | | | | | | The later is not correct Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: check s->streams[k] before using itAndreas Cadhalpun2015-05-04
| | | | | | | | | | | | | | This fixes a segmentation fault. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: use uint64_t instead of int for index_scaleAndreas Cadhalpun2015-05-04
| | | | | | | | | | | | | | | | | | | | | | index_scale is set to matroska->time_scale of type uint64_t. When index_scale is int, the assignment can overflow and e.g. result in index_scale = 0. This causes a floating point exception due to the division by index_scale. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Mark static tables as constMichael Niedermayer2015-05-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: remove now duplicate doctype checkMichael Niedermayer2015-04-19
| | | | | | | | | | | | See: b8d7f3186e86234f6255f5e8ee9e98573b4d9a6e See: d9fe6b926cd619c311e45e0ae352cf09713c482c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'b8d7f3186e86234f6255f5e8ee9e98573b4d9a6e'Michael Niedermayer2015-04-18
|\| | | | | | | | | | | | | * commit 'b8d7f3186e86234f6255f5e8ee9e98573b4d9a6e': matroskadec: fix crash when parsing invalid mkv Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskadec: fix crash when parsing invalid mkvThomas Guillem2015-04-18
| | | | | | | | | | | | CC: libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'c4d37cd9ef6e374bb888f6273259b10fac5bd909'Michael Niedermayer2015-04-08
|\| | | | | | | | | | | | | | | | | | | | | * commit 'c4d37cd9ef6e374bb888f6273259b10fac5bd909': matroskadec: export cover art correctly Conflicts: libavformat/matroskadec.c See: 511585ce7f7272e5069ef011d6be5f073d268901 Merged-by: Michael Niedermayer <michaelni@gmx.at>