aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/matroskadec.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/matroskadec: Fix number suffixesMichael Niedermayer2015-02-011-1/+1
| | | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit fc3cdb00d084222a107e61e7168903bf3d3d0b47) Conflicts: libavformat/matroskadec.c
* avformat/matroskadec: Use av_freep() to avoid leaving stale pointers in memoryMichael Niedermayer2015-01-061-4/+4
| | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 6e70e4aca50696040cc9256ec96e5c31d9641432) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/matroskadec: fix handling of recursive SeekHead elementswm42014-12-301-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | When matroska_execute_seekhead() is called, it goes through the list of seekhead entries and attempts to read elements not read yet. When doing this, the parser can find further SeekHead elements, and will extend the matroska->seekhead list. This can lead to a (practically) infinite loop with certain broken files. (Maybe it can happen even with valid files. The demuxer doesn't seem to check correctly whether an element has already been read.) Fix this by ignoring elements that were added to the seekhead field during executing seekhead entries. This does not fix the possible situation when multiple SeekHead elements after the file header (i.e. occur after the "before_pos" file position) point to the same elements. These elements will probably be parsed multiple times, likely leading to bugs. Fixes ticket #4162. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 6551acab6877addae815decd02aeca33ba4990c8) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/matroskadec: support SVQ3 as generated by mkvtoolnix-6.6.0Michael Niedermayer2014-04-161-1/+5
| | | | | | | Fixes part of Ticket3256 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 5800b08572ef5f776950fc6f1b6572ba9a6b1933)
* avformat/matroskadec: Fix start_timeAlex Sukhanov2014-01-261-1/+1
| | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 251c96a70b0d8cc729ded8c09c7b8bfe03f1a138) Fixes ticket #3337.
* Do not read mkv audio bit_depth if bits_per_coded_sample is already set.Carl Eugen Hoyos2014-01-161-0/+1
| | | | | This allows decoding broken mkv files containing G.726 audio. (cherry picked from commit 11329370770e5c982deece7d4eb4f2e95e725332)
* avformat/matroskadec: check generic audio deinterleaver sub_packet_size ↵Michael Niedermayer2014-01-131-1/+1
| | | | | | | | | | | | against frame_size Fixes use of uninitialized memory Fixes: msan_uninit-mem_7f67d052a530_7517_nosound.mkv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit a1ed1c2193483849df689b105bec0d26c2497999) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavf/matroskadec ReferenceBlock is a signed integerJan Gerber2014-01-071-1/+1
| | | | | | | | | | according to the Matroska Specification ReferenceBlock is a signed integer too. Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 8cc59ec881b8706fb3036a2a83f7ededa468dedb) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavf/matroska*: DiscardPadding is a signed integerJan Gerber2014-01-071-4/+4
| | | | | | | | | | | | | according to the Matriska Specification http://matroska.org/technical/specs/index.html DiscardPadding is a signed integer. Tested-by: Jan Gerber <j@v2v.cc> Tested-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit f4b1ca99ff86c6ba78e1b4730c85eac0d5a5817a) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/matroska: simplify signed int access codeMichael Niedermayer2014-01-071-5/+1
| | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit cddd15ba5c9cd2e92d2f2942e0fc40bf3bf56115) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavf/matroska*: add support for signed integersJan Gerber2014-01-071-0/+30
| | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit d03eea36b2c329241f63c8aca2d6adbb6ea81d9c) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* matroskadec: Fix bug when parsing realaudio codec parametersJames Almer2013-12-301-1/+1
| | | | | | | | | | flavor can be 0. This fixes tract ticket #3214 Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 0d944ee34349805b29f9c91b15c8009d16df01ab)
* lavf/matroskadec: Support HEVC demuxing.Yusuke Nakamura2013-10-161-1/+2
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* matroskadec: Demux support for SeekPreRoll and CodecDelayVignesh Venkatasubramanian2013-10-141-0/+15
| | | | | | | | Adds support for demuxing SeekPreRoll and CodecDelay container elements. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat: use ff_alloc_extradata()Paul B Mahol2013-10-131-7/+2
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avformat/matroskadec: only set r_frame_rate if the value is within ↵Michael Niedermayer2013-10-061-1/+2
| | | | | | | | reasonable limits Fixes Ticket2451 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '668643b9239c70b777aea322eab411ebc960d9a0'Michael Niedermayer2013-09-251-1/+7
|\ | | | | | | | | | | | | * commit '668643b9239c70b777aea322eab411ebc960d9a0': matroskadec: check av_strdup() when setting defaults Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskadec: check av_strdup() when setting defaultsAnton Khirnov2013-09-241-1/+7
| |
* | matroska: Add the CueDuration elementJames Almer2013-09-211-0/+1
| | | | | | | | | | | | | | | | | | Use it only on subtitle CuePoints. With proper demuxer/splitter support this should improve the display of subtitles right after seeking to a given point in the stream. Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: correct spurious keyframe warnings in webmMonty Montgomery2013-09-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | Minor change to fix for Trac #1003 to avoid squawking about files with valid keyframes that aren't marked (as opposed to frames that are marked as keyframes and aren't). Change correctly surpresses the spurious warnings, while still complaining about (and handling) the genuinely broken file attached to bug #1003. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: use av_malloc_array() and check for allocation errorPaul B Mahol2013-09-191-1/+3
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '569d18aa9dc989c37bb4d4b968026fe5afa6fff9'Michael Niedermayer2013-09-171-0/+4
|\| | | | | | | | | | | | | * commit '569d18aa9dc989c37bb4d4b968026fe5afa6fff9': matroskadec: Verify realaudio codec parameters Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskadec: Verify realaudio codec parametersMartin Storsjö2013-09-171-0/+4
| | | | | | | | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* | matroskadec: Mute "Unknown entry" log messages for CueRelativePosition entriesJames Almer2013-09-151-0/+1
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: use av_realloc_array()Michael Niedermayer2013-09-111-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: ebml_parse_elem() should not deallocate priorly ↵Michael Niedermayer2013-09-111-6/+5
| | | | | | | | | | | | | | | | existing lists on failure This reverts a hunk from "avformat: Use av_reallocp_array() where suitable" Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f369b9356c4606cd4d713d60f7db5de119d901fa'Michael Niedermayer2013-09-111-5/+6
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'f369b9356c4606cd4d713d60f7db5de119d901fa': avformat: Use av_reallocp_array() where suitable Conflicts: libavformat/asfenc.c libavformat/gxfenc.c libavformat/mov.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Use av_reallocp_array() where suitableAlexandra Khirnova2013-09-101-5/+6
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | opus/matroska: Adding support for End Trimming in demuxer/decoderVignesh Venkatasubramanian2013-09-101-5/+25
| | | | | | | | | | | | | | | | | | Implementing support for end trimming Opus in Matroska by making use of the DiscardPadding value from the container and discarding the samples accordingly. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '5bcd3ae5b167fb74215520b01d5d810e0c8986ab'Michael Niedermayer2013-09-041-1/+2
|\| | | | | | | | | | | | | | | | | | | | | * commit '5bcd3ae5b167fb74215520b01d5d810e0c8986ab': matroskadec: Check that .lang was allocated and set before reading it Conflicts: libavformat/matroskadec.c See: 01fd1aa0ad2b95045df35f94ee9de073d24609c8 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskadec: Check that .lang was allocated and set before reading itMartin Storsjö2013-09-031-1/+2
| | | | | | | | | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* | avformat/matroskadec: add WebVTT supportMatthew Heaney2013-08-191-1/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | WebM files now support inband text tracks, as described in the following specification: http://wiki.webmproject.org/webm-metadata/temporal-metadata/webvtt-in-webm The Matroska demuxer now detects the presence of WebVTT tracks, synthesizing WebVTT packets (having codec id AV_CODEC_ID_WEBVTT) and pushing them downstream in the normal way. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: check out_samplerate before using it in av_rescale()Michael Niedermayer2013-08-181-0/+2
| | | | | | | | | | | | Prevent assertion failure with damaged input Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: Improve TTA duration calculationJames Almer2013-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calculate the duration as accurately as possible to improve decoding of samples where the last frame is smaller than the rest. Example: Take lossless-audio/luckynight-partial.tak from the FATE suit and convert it to TTA muxed into matroska: ffmpeg -i $(SAMPLES)/lossless-audio/luckynight-partial.tak -c:a tta lucky.mka The framemd5 output for lucky.mka without this patch: 0, 0, 0, 46080, 184320, 7c3751ddd571d2903c3cf0ab4b3e3d0a 0, 46080, 46080, 46080, 184320, 6b70c782ba1da3f933fde2daa4f96b73 0, 92160, 92160, 46080, 184320, dcf70d89c54b9a4f0b302d4ec4fb302d 0, 138240, 138240, 46080, 184320, 48713ca38b388d2ea4abf5b86ed1226f 0, 184320, 184320, 46080, 184320, 12188a23648e7ebfb07cd6fe9197b2ea 0, 230400, 230400, 46080, 184320, 49653ab8186a5d4a044ed284671a26e0 0, 276480, 276480, 46080, 184320, 5e82c6a7fe58c7ea612c03a0a2927dd4 0, 322560, 322560, 46080, 184320, 83dc449dbd9eab5f2e8ad2b4403d6a21 0, 368640, 368640, 46080, 184320, bdd6b92c23d30978d4e802d305b0fc49 With this patch: 0, 0, 0, 46080, 184320, 7c3751ddd571d2903c3cf0ab4b3e3d0a 0, 46080, 46080, 46080, 184320, 6b70c782ba1da3f933fde2daa4f96b73 0, 92160, 92160, 46080, 184320, dcf70d89c54b9a4f0b302d4ec4fb302d 0, 138240, 138240, 46080, 184320, 48713ca38b388d2ea4abf5b86ed1226f 0, 184320, 184320, 46080, 184320, 12188a23648e7ebfb07cd6fe9197b2ea 0, 230400, 230400, 46080, 184320, 49653ab8186a5d4a044ed284671a26e0 0, 276480, 276480, 46080, 184320, 5e82c6a7fe58c7ea612c03a0a2927dd4 0, 322560, 322560, 46080, 184320, 83dc449dbd9eab5f2e8ad2b4403d6a21 0, 368640, 368640, 46080, 184320, bdd6b92c23d30978d4e802d305b0fc49 0, 414720, 414720, 4230, 16920, b50b440c5bbcecb8e9fbece643447593 The duration without this patch was calculated as 418950000000, which is bigger than uint32_t and as such stored as 2338172288. With this patch the duration is correctly calculated as 418950. Signed-off-by: James Almer <jamrial@gmail.com> Approved-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: make sipr_bit_rate static constMichael Niedermayer2013-08-041-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Detect conflicting sample rate/default_durationMichael Niedermayer2013-07-151-1/+10
| | | | | | | | | | | | | | Fixes Ticket2508 Thanks-to: Moritz Bunkus Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '8835c554ff506992c47f6e347c74216ae073f0fa'Michael Niedermayer2013-06-111-8/+7
|\| | | | | | | | | | | | | | | | | | | * commit '8835c554ff506992c47f6e347c74216ae073f0fa': matroskadec: introduce resync function. Conflicts: libavformat/matroskadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskadec: introduce resync function.Sean McGovern2013-06-101-4/+43
| | | | | | | | | | | | | | | | | | | | 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-081-12/+13
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | matroskadec: fix memleak of pkt_dataMichael Niedermayer2013-06-031-1/+2
| | | | | | | | | | Fixes: CID1026767 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: favor av_freep()Michael Niedermayer2013-06-031-1/+1
| | | | | | | | | | | | 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-281-0/+98
|\| | | | | | | | | | | | | | | | | | | | | * 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-281-0/+98
| | | | | | | | | | 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-281-0/+1
|\| | | | | | | | | | | | | | | | | | | | | * 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-271-0/+1
| | | | | | | | | | 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-261-4/+5
| | | | | | | | | | | | 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-191-1/+1
| | | | | | | | | | | | 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-071-1/+0
| | | | | | | | | | | | Fixes playback of test7.mkv validation test file. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge commit 'e0f8be6413b6a8d334d6052e610af32935c310af'Michael Niedermayer2013-05-051-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-041-1/+1
| |