summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
Commit message (Collapse)AuthorAge
* Merge commit '8835c554ff506992c47f6e347c74216ae073f0fa'Michael Niedermayer2013-06-11
|\ | | | | | | | | | | | | | | | | | | * commit '8835c554ff506992c47f6e347c74216ae073f0fa': matroskadec: introduce resync function. Conflicts: libavformat/matroskadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * 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: move ALAC extradata creation bellow AAC onePaul B Mahol2013-06-08
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | matroskadec: fix memleak of pkt_dataMichael Niedermayer2013-06-03
| | | | | | | | | | Fixes: CID1026767 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: favor av_freep()Michael Niedermayer2013-06-03
| | | | | | | | | | | | av_freep() is safer as it zeros the pointer Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-05-28
|\| | | | | | | | | | | | | | | | | | | | | * qatar/master: smacker: assign video frame PTS matroskadec: export full wavpack blocks. Conflicts: libavcodec/wavpack.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * 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.
* | Merge commit '564b7e0c0095768cd20001b28154d69462be54e7'Michael Niedermayer2013-05-28
|\| | | | | | | | | | | | | | | | | | | | | * commit '564b7e0c0095768cd20001b28154d69462be54e7': matroskadec: silently skip CodecState element. smacker: fix off-by-one error in palette expanding code Conflicts: libavformat/smacker.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * 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.
* | matroska_read_seek: Fix used streams for subtitle index compensationMichael Niedermayer2013-05-26
| | | | | | | | | | | | Might fix Ticket1907 (I have no testcase so i cant test) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: fix integer overflowMichael Niedermayer2013-05-19
| | | | | | | | | | | | Fixes fate-mkv with ekopath 4 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroska: set "done" only during resync fail.Reimar Döffinger2013-05-07
| | | | | | | | | | | | Fixes playback of test7.mkv validation test file. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge commit 'e0f8be6413b6a8d334d6052e610af32935c310af'Michael Niedermayer2013-05-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e0f8be6413b6a8d334d6052e610af32935c310af': avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriate Conflicts: libavformat/ac3dec.c libavformat/avformat.h libavformat/avs.c libavformat/m4vdec.c libavformat/mov.c libavformat/mp3dec.c libavformat/mpeg.c libavformat/mpegvideodec.c libavformat/psxstr.c libavformat/pva.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriateDiego Biurrun2013-05-04
| |
* | subtitles: introduce ASS codec id and use it.Clément Bœsch2013-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we have a AV_CODEC_ID_SSA, which matches the way the ASS/SSA markup is muxed in a standalone .ass/.ssa file. This means the AVPacket data starts with a "Dialogue:" string, followed by a timing information (start and end of the event as string) and a trailing CRLF after each line. One packet can contain several lines. We'll refer to this layout as "SSA" or "SSA lines". In matroska, this markup is not stored as such: it has no "Dialogue:" prefix, it contains a ReadOrder field, the timing information is not in the payload, and it doesn't contain the trailing CRLF. See [1] for more info. We'll refer to this layout as "ASS". Since we have only one common codec for both formats, the matroska demuxer is constructing an AVPacket following the "SSA lines" format. This causes several problems, so it was decided to change this into clean ASS packets. Some insight about what is changed or unchanged in this commit: CODECS ------ - the decoding process still writes "SSA lines" markup inside the ass fields of the subtitles rectangles (sub->rects[n]->ass), which is still the current common way of representing decoded subtitles markup. It is meant to change later. - new ASS codec id: AV_CODEC_ID_ASS (which is different from the legacy AV_CODEC_ID_SSA) - lavc/assdec: the "ass" decoder is renamed into "ssa" (instead of "ass") for consistency with the codec id and allows to add a real ass decoder. This ass decoder receives clean ASS lines (so it starts with a ReadOrder, is followed by the Layer, etc). We make sure this is decoded properly in a new ass-line rectangle of the decoded subtitles (the ssa decoder OTOH is doing a simple straightforward copy). Using the packet timing instead of data string makes sure the ass-line now contains the appropriate timing. - lavc/assenc: just like the ass decoder, the "ssa" encoder is renamed into "ssa" (instead of "ass") for consistency with the codec id, and allows to add a real "ass" encoder. One important thing about this encoder is that it only supports one ass rectangle: we could have put several dialogue events in the AVPacket (separated by a \0 for instance) but this would have cause trouble for the muxer which needs not only the start time, but also the duration: typically, you have merged events with the same start time (stored in the AVPacket->pts) but a different duration. At the moment, only the matroska do the merge with the SSA-line codec. We will need to make sure all the decoders in the future can't add more than one rectangle (and only one Dialogue line in it obviously). FORMATS ------- - lavf/assenc: the .ass/.ssa muxer can take both SSA and ASS packets. In the case of ASS packets as input, it adds the timing based on the AVPacket pts and duration, and mux it with "Dialogue:", trailing CRLF, etc. - lavf/assdec: unchanged; it currently still only outputs SSA-lines packets. - lavf/mkv: the demuxer can now output ASS packets without the need of any "SSA-lines" reconstruction hack. It will become the default at next libavformat bump, and the SSA support will be dropped from the demuxer. The muxer can take ASS packets since it's muxed normally, and still supports the old SSA packets. All the SSA support and hacks in Matroska code will be dropped at next lavf bump. [1]: http://www.matroska.org/technical/specs/subtitles/ssa.html
* | matroskadec: Check EBML lace sizes.Michael Niedermayer2013-04-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: Check for overflows in xiph lace decodingMichael Niedermayer2013-04-04
| | | | | | | | | | | | This also detects errors earlier Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: fix return code for too long xiph lacesMichael Niedermayer2013-04-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'bcc94328980e6c56546792ab08b0756abdce310b'Michael Niedermayer2013-04-04
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'bcc94328980e6c56546792ab08b0756abdce310b': opt: check the return values of av_get_token for ENOMEM. doc: Fix best_nb_channells typo matroska: pass the lace size to the matroska_parse_rm_audio Conflicts: libavformat/matroskadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * 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
* | Merge commit '8a96df7b70be509dae9ceec82d2c10a20361356d'Michael Niedermayer2013-04-04
|\| | | | | | | | | | | | | * commit '8a96df7b70be509dae9ceec82d2c10a20361356d': matroska: fix a corner case in ebml-lace parsing Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * 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
| |
* | matroskadec: fix display_width/height = 0 handlingMichael Niedermayer2013-04-03
| | | | | | | | | | | | Fixes Ticket2424 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix heap-buffer-overflow in matroska_parse_blockDale Curtis2013-03-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: switch to av_assertMichael Niedermayer2013-03-22
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: Add support for parsing Matroska ContentEncKeyIDFrank Galligan2013-03-20
| | | | | | | | | | | | | | | | | | This patch adds the enums for the ContentEncryption elements. This patch also adds support for parsing the ContentEncKeyID. The ContentEncKeyID is then base64 encoded and stored in the stream's metadata. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroska_parse_frame: fix memleakMichael Niedermayer2013-03-19
| | | | | | | | | | Fixes CID991856 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: avoid integer overflowMichael Niedermayer2013-03-15
| | | | | | | | | | Found-by: wm4 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '1afddbe59e96af75f1c07605afc95615569f388f'Michael Niedermayer2013-03-08
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1afddbe59e96af75f1c07605afc95615569f388f': avpacket: use AVBuffer to allow refcounting the packets. Conflicts: libavcodec/avpacket.c libavcodec/utils.c libavdevice/v4l2.c libavformat/avidec.c libavformat/flacdec.c libavformat/id3v2.c libavformat/matroskaenc.c libavformat/mux.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * 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.
* | Removing network.h from matroskadec.cVignesh Venkatasubramanian2013-02-14
| | | | | | | | | | | | | | Removing accidentally added include file. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Adding AlphaMode element to Matroska ParserVignesh Venkatasubramanian2013-02-14
| | | | | | | | | | | | | | | | | | Adding support for parsing AlphaMode element in the Track header and export that information as a metadata tag. This flag indicates presence of alpha channel data in BlockAdditional element. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: simplify additional_id writing codeMichael Niedermayer2013-02-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Adding support for parsing BlockAdditionalVignesh Venkatasubramanian2013-02-14
| | | | | | | | | | | | | | | | | | | | | | Matroska specification lists support for BlockAdditional element which is not supported by ffmpeg's matroska parser. This patch adds grammar definitions for parsing that element (and few other related elements) and then puts the data in AVPacket.side_data with new AVPacketSideDataType AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: support seek to non keyframesMichael Niedermayer2013-02-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: export codec bits_per_coded_samplePaul B Mahol2013-01-24
| | | | | | | | | | | | Fixes -codec copy with TTA from matroska to matroska. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '7b8c5b263bc680eff5710bee5994de39d47fc15e'Michael Niedermayer2013-01-11
|\| | | | | | | | | | | | | | | * commit '7b8c5b263bc680eff5710bee5994de39d47fc15e': vc1dec: prevent a crash due missing pred_flag parameter matroska: Fix use after free Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroska: Fix use after freeDale Curtis2013-01-11
| | | | | | | | | | Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | matroskadec: fix ffio_init_context() usageMichael Niedermayer2013-01-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: reset size when freeing data.Michael Niedermayer2012-12-04
| | | | | | | | | | | | | | Fixes null pointer dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | replace av_log(0, by av_log(NULL,Michael Niedermayer2012-11-23
| | | | | | | | | | | | The first parameter is a pointer and NULL is more correct Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: check h in generic rm packet shufflerMichael Niedermayer2012-11-11
| | | | | | | | | | | | | | Fixes crash Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ebml_read_binary: use fast_padded_malloc()Michael Niedermayer2012-11-09
| | | | | | | | | | | | | | Fixes out of array accesses Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-11-03
|\| | | | | | | | | | | | | | | | | | | | | | | * qatar/master: doc: add apidoc target for doxygen API documentation matroskadec: do not use avpacket internals Conflicts: doc/Makefile libavformat/matroskadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskadec: do not use avpacket internalsAnton Khirnov2012-11-02
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-10-25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: avutil: Make LZO decoder code configure-time selectable avutil: Move memcpy_backptr() to mem.c configure: detect parisc64 automatically configure: detect ppc64 automatically configure: detect mips64 automatically configure: generalise 64-bit test smoothstreamingenc: Don't assume streams start from timestamp 0 Conflicts: configure libavutil/Makefile libavutil/lzo.c libavutil/lzo.h libavutil/mem.c libavutil/mem.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avutil: Make LZO decoder code configure-time selectableDiego Biurrun2012-10-25
| |