summaryrefslogtreecommitdiff
path: root/libavformat/matroskadec.c
Commit message (Collapse)AuthorAge
* 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>
| * 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: Add support for parsing live header filesVignesh Venkatasubramanian2015-04-05
| | | | | | | | | | | | | | | | | | | | | | This patch adds support for parsing live files (produced by -f webm_chunk) which contains only the headers but no packets. This is only used when using -f webm_dash_manifest. There will be a follow up patch which adds live support to WebM DASH Manifest muxer. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskadec: export cover art correctlywm42015-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Fixes trac #4423. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '6bdae41d3ef74a0865e8f87896e649f93b2f39bd'Michael Niedermayer2015-03-12
|\| | | | | | | | | | | | | | | | | | | | | * commit '6bdae41d3ef74a0865e8f87896e649f93b2f39bd': matroskadec: Check memory allocations Conflicts: libavformat/matroskadec.c See: 3e2a5b33f0355eeb80b6b2805be7f1b4fa1d1a46 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskadec: Check memory allocationsVittorio Giovara2015-03-12
| | | | | | | | CC: libav-stable@libav.org
* | Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'Michael Niedermayer2015-02-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e': avformat: Don't anonymously typedef structs Conflicts: libavformat/adtsenc.c libavformat/aiffenc.c libavformat/avidec.c libavformat/gif.c libavformat/iff.c libavformat/img2dec.c libavformat/jvdec.c libavformat/matroskadec.c libavformat/udp.c libavformat/wtvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * 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
* | avformat/matroskadec: fix IGNIDX handlingwm42015-02-12
| | | | | | | | | | | | | | | | | | | | | | Just because the user requested the seek index to be ignored, we can't just skip essential headers. At least tags are often located at the end of the file, and the old code simply ignored the seekhead for all elements, not just the cue index. Also, it looks like it used the index even if IGNIDX was set if the cue index was located in the beginning of the file. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroska: redo seekhead handlingwm42015-02-12
| | | | | | | | | | | | | | | | | | | | | | In particular, this reads chained seekheads. This makes seeking faster in files which have the index indirectly linked through 2 seekheads. As a side-effect, this warns when reading level-1 (toplevel) elements multiple times (other than seekheads, clusters, and void/crc). Such elements are not valid and likely break everything. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroska: don't complain about unknown elementswm42015-02-09
| | | | | | | | | | | | | | | | | | | | | | | | Matroska is an extensible format - unknown elements must be expected. It shouldn't complain about such elements to the user either; it'll just generate noise. The "error_recognition & AV_EF_EXPLODE" is completely, wrong why would it explode on valid files? It's still useful for debugging, so the message is left in place with a higher log level. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Fix number suffixesMichael Niedermayer2015-02-01
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Use av_malloc_array() for index_entriesMichael Niedermayer2015-01-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Check av_mallocz() return valuesMichael Niedermayer2015-01-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Use av_freep() to avoid leaving stale pointers in memoryMichael Niedermayer2015-01-06
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | wavdec: RIFX file format supportThomas Volkert2014-12-18
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: request a sample with recursive seek headsMichael Niedermayer2014-12-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: fix handling of recursive SeekHead elementswm42014-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | msvc: Fix compilation errors due to header include order.Matthew Oliver2014-11-27
| | | | | | | | | | | | | | Ensures that the header include order is such that winsock2.h is always included before windows.h or that windows.h does not include winsock.h. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix read-after-free in matroska_read_seek().Xiaohan Wang2014-11-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In matroska_read_seek(), |tracks| is assigned at the begining of the function. However, functions like matroska_parse_cues() could reallocate the tracks so that |tracks| can get invalidated. This CL assigns |tracks| only before we use it so that it won't be invalidated. BUG=427266 TEST=Test case in associated bug passes now. Change-Id: I9c7065fe8f4311ca846076281df2282d190ed344 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: use gmtime_r() for thread safteyMichael Niedermayer2014-11-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: Check the return code from strftime()Michael Niedermayer2014-10-26
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e0caa1eb4e518111a81801db0d2ccdd2733ba94b'Michael Niedermayer2014-10-25
|\| | | | | | | | | | | | | | | | | | | | | * commit 'e0caa1eb4e518111a81801db0d2ccdd2733ba94b': matroskadec: check return values Conflicts: libavformat/matroskadec.c See: 1116491c53156dd1972eca3e65d5a3b8529c4658 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * 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
* | avformat/matroskadec: Fix cluster parsing loop which gathers seek informationMichael Niedermayer2014-10-22
| | | | | | | | | | | | | | | | Fixes Ticket2263 Fixes Ticket3934 Reviewed-by: Rodger Combs <rodger.combs@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/webm_dash: Allow filenames without directoriesVignesh Venkatasubramanian2014-10-10
| | | | | | | | | | | | | | | | Fix basename computation code to allow just file names without any directories in the path. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/matroskadec: do not trust the default duration to be the real ↵Michael Niedermayer2014-10-08
| | | | | | | | | | | | | | | | 1/timebase if its less than 5fps Fixes Ticket3980 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/webm_dash: Fix incorrect bandwidth computationVignesh Venkatasubramanian2014-10-01
| | | | | | | | | | | | | | | | | | Fix incorrect bandwidth computation in some cases. When the cue end descriptor is null (i.e.) start_time_ns == -1, existing bandwidth computed (if any) should be returned rather than returning 0. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/webm_dash: fix hardcode in cues_end computationVignesh Venkatasubramanian2014-10-01
| | | | | | | | | | | | | | | | | | | | Fix an incorrect hard code in cues_end computation. Updating the fate test reference files related to the fix as well. The earlier computation was clearly wrong as the cues_end field was greater than the file size itself in some cases. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat: remove FF_API_ASS_SSA dead codeClément Bœsch2014-09-09
| |
* | avformat: drop redundant MATROSKA_VIDEO_STEREO_MODE_COUNT identifierMichael Niedermayer2014-08-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'd4ae8ac92f619507aadd021bb67b517d39d3a36f'Michael Niedermayer2014-08-28
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd4ae8ac92f619507aadd021bb67b517d39d3a36f': matroskadec: parse stereo mode on decoding Conflicts: Changelog libavformat/matroska.c libavformat/matroskadec.c See: 4c509fe305bc79a913ef1b690df6c910c732f608 and others Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * 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
* | Merge commit 'f2583bc86eb5d7decc639fc9a36edc93e6003eef'Michael Niedermayer2014-08-28
|\| | | | | | | | | | | | | * commit 'f2583bc86eb5d7decc639fc9a36edc93e6003eef': matroska: list supported extensions Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroska: list supported extensionsVittorio Giovara2014-08-28
| |
* | lavf/matroskadec: Ensure cues_end is initializedVignesh Venkatasubramanian2014-08-25
| | | | | | | | | | | | | | | | | | | | | | Ensure that cues_start and cues_end are always initialized and the webm_dash_manifest_cues function returns appropriate error if they are not computed correctly. This fixes coverity defect CID1231991. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Use new av_dict_set_int helper function.Reimar Döffinger2014-08-16
| | | | | | | | | | | | | | Get rid of the many, slightly differing, implementations of basically the same thing. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Drop remaining unneeded != NULLMichael Niedermayer2014-08-15
| | | | | | | | | | Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '4b1f5e5090abed6c618c8ba380cd7d28d140f867'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '4b1f5e5090abed6c618c8ba380cd7d28d140f867': cosmetics: Write NULL pointer inequality checks more compactly Conflicts: libavcodec/dvdsubdec.c libavcodec/h263dec.c libavcodec/libxvid.c libavcodec/rv10.c libavcodec/utils.c libavformat/format.c libavformat/matroskadec.c libavformat/segment.c libavutil/opt.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer inequality checks more compactlyGabriel Dume2014-08-15
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-15
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avformat/matroskadec: Check avpriv_new_chapter() for failureJustin Jacobs2014-08-08
| | | | | | | | | | | | Fixes null pointer dereference Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | replace calls to url_feof() with avio_feof()James Almer2014-08-08
| | | | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'fa38573cd9ce4ab727f86f57c03b113cfd4c9d0a'Michael Niedermayer2014-07-29
|\| | | | | | | | | | | | | * commit 'fa38573cd9ce4ab727f86f57c03b113cfd4c9d0a': matroska: Register mime types Merged-by: Michael Niedermayer <michaelni@gmx.at>