summaryrefslogtreecommitdiff
path: root/libavformat/mxfdec.c
Commit message (Collapse)AuthorAge
* mxfdec: Ignore the last entry in Avid's index table segmentsTomas Härdin2012-02-09
| | | | | | | | The last entry is the total size of the essence container. Previously a TemporalOffset error would be logged, even though segments like these are expected. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Sanity-check SampleRateTomas Härdin2012-02-09
| | | | | | This avoids a SIGFPE if SampleRate is missing or set to naughty values. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Handle small EditUnitByteCountTomas Härdin2012-02-09
| | | | | | | These are common with audio atoms. Without this the demuxer would read two bytes at a time for a mono 16-bit file. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Consider OPAtom files that do not have exactly one EC to be OP1aTomas Härdin2012-02-09
| | | | | | This fixes demuxing of 2011_DCPTEST_24FPS.V.mxf. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflowsTomas Härdin2012-02-09
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Zero nb_ptses in mxf_compute_ptses_fake_index()Tomas Härdin2012-02-09
| | | | | | This fixes SIGSEGV on files with both CBR and VBR index segments (zzuf6.mxf). Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Sanity check PreviousPartitionTomas Härdin2012-02-09
| | | | | | Without this certain files could get the demuxer stuck in a loop. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Never seek back in local sets and KLVsTomas Härdin2012-02-09
| | | | | | | | | Specially crafted files can lead the parsing code to take too long. We fix a lot of these problems by not allowing local tags to extend past the end of the set and not allowing other KLVs to be read past the end of themselves. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Move the current_partition check inside mxf_read_header()Tomas Härdin2012-02-09
| | | | | | This fixes SIGSEGV on files where this is the case, such as zzuf4.mxf. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Fix infinite loop in mxf_packet_timestamps()Tomas Härdin2012-02-09
| | | | | | | This can happen if an index table segment has a very large IndexStartPosition. zzuf3.mxf is an example of such a file. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Check eof_reached in mxf_read_local_tags()Tomas Härdin2012-02-09
| | | | | | This fixes an infinite loop with zzuf2.mxf. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Check for NULL componentTomas Härdin2012-02-09
| | | | | | This fixes a SIGSEGV with zzuf1.mxf. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Make sure mxf->nb_index_tables > 0 in mxf_packet_timestamps()Tomas Härdin2012-02-09
| | | | | | | Only the OPAtom demuxing logic is guaranteed to have index tables, meaning OP1a files that lack an index would cause SIGSEGV. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Make sure x < index_table->nb_ptsesTomas Härdin2012-02-09
| | | | | | Avoids a SIGSEGV on files with IndexEntryCount < IndexDuration. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* lavf: remove AVFormatParameters from AVFormatContext.read_header signatureAnton Khirnov2012-01-27
|
* mxfdec: Fix files with essence containers larger than 2 GiB.Tomas Härdin2012-01-26
| | | | | | For such files, accumulating into an int would cause an overflow. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: Employ correct printf conversion specifiers for POSIX int types.Jean First2012-01-26
| | | | | Signed-off-by: Jean First <jeanfirst@gmail.com> Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: fix memleak on mxf_read_close()Janne Grunau2012-01-23
|
* mxfdec: fix memleak on av_realloc failuresJanne Grunau2012-01-22
|
* mxfdec: Do not parse slices or DeltaEntryArrays.Tomas Härdin2012-01-22
| | | | The most recent demuxing/seeking code does not need them.
* mxfdec: hybrid demuxing/seeking solutionJanne Grunau2012-01-22
| | | | | | | | | | | | | | | | | | This uses the old demuxing code for OP1a and separate demuxing code for OPAtom. Timestamp output is added to the old demuxing code. The seeking code is made to seek to the start of the desired EditUnit only, from which the normal demuxing code takes over (if OP1a). This means we do not use delta entries or slices, only StreamOffsets. OPAtom seeking basically works like before. This also makes D-10 seeking behave the same way as OP1a and OPAtom. In other words, we allow seeking before the start or past the end for D-10 too. Based on several patches by Tomas Härdin <tomas.hardin@codemill.se> and Reimar Döffinger <Reimar.Doeffinger@gmx.de>. Changed av_calloc to av_mallocz, added overflow checks.
* mxfdec: Add Avid's essence element key.Tomas Härdin2012-01-22
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mfxdec: Separate mxf_essence_container_uls for audio and video.Carl Eugen Hoyos2012-01-22
| | | | | | | | | It is a really bad idea to assign a video codec id when we have set codec_type to audio and vice versa. Prevents detection of mp2 in mxf as mpeg2video. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Compute packet offsets properly.Tomas Härdin2012-01-22
| | | | | | This replaces the old essence_offset code. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Use MaterialPackage - Track - TrackID instead of the system_item hack.Tomas Härdin2012-01-22
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: use av_dlog() for 'no corresponding source package found'Tomas Härdin2012-01-22
| | | | | | This is not an error and expected behavior for OPAtom files. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Make mxf->partitions sorted by offset.Tomas Härdin2012-01-22
| | | | | | This also zeroes new entries for good measure (used by future patches). Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: parse ThisPartitionTomas Härdin2012-01-22
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Speed up metadata and index parsing.Tomas Härdin2012-01-22
| | | | | | | | | | | | | Specifically, this means parsing as before until we run into essence. At that point we seek to the footer and parse until EOF. After that we start seeking backward to the previous partition and parse that until we run into essence or the next partition. This procedure is repeated until we encounter the last partition we parsed in the forward direction. The end result of all this is that large essence containers are not needlessly parsed. This speeds up parsing large files a lot. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Make sure DataDefinition is consistent between material track and ↵Tomas Härdin2012-01-22
| | | | | | | | | source track. This fixes 0001GL.MXF.V1.mxf_opatom.mxf and 0001GL00.MXF.A1.mxf_opatom.mxf getting two streams each due to both using the same SourcePackageID. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: add EssenceContainer UL found in 0001GL00.MXF.A1.mxf_opatom.mxfTomas Härdin2012-01-22
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Add hack that adjusts the n_delta calculation when system items are ↵Tomas Härdin2012-01-22
| | | | | | present. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: Parse IndexTableSegments and convert them into AVIndexEntry arrays.Janne Grunau2012-01-22
| | | | | | | Based on patch from Tomas Härdin <tomas.hardin@codemill.se> and work by Georg Lippitsch <georg.lippitsch@gmx.at> Changed av_calloc to av_mallocz and added overflow checks.
* mxfdec: Move FooterPartition to MXFContext and make sure it is never zero.Tomas Härdin2012-01-22
| | | | Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: check return value of avio_seekJoakim Plate2012-01-22
| | | | | | Avoid modifying state if avio_seek fails. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: skip to end of structural setsPhilip de Nier2012-01-22
| | | | | | | | This fixes reading of partition packs. The code stops reading after the operational pattern and should skip the array of essence container labels that follow. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* mxfdec: parse MXF partitionsTomas Härdin2012-01-22
|
* mov, mxfdec: Employ more meaningful return values.Daniel Huang2012-01-15
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mxfdec: consider QuantizationBits between 17 and 24 to be pcm_s24*Tomas Härdin2011-12-21
| | | | | | This fixes playback of BRD38772509.mxf. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* lavf: make av_set_pts_info private.Anton Khirnov2011-11-30
| | | | It's supposed to be called only from (de)muxers.
* mxfdec: Fix comparison of unsigned expression < 0.Alex Converse2011-11-08
| | | | | 'size' is populated by functions returning int64_t and int that return negative error codes.
* lavf: make some seeking functions privateAnton Khirnov2011-10-28
| | | | | | | Specifically av_update_cur_dts(), av_seek_frame_binary() and av_gen_search(). They are not supposed to be called outside lavf.
* lavf: replace av_new_stream->avformat_new_stream part II.Anton Khirnov2011-10-19
| | | | | | | | Manual replacements are done in this commit. In many cases, the id is some constant made up number (e.g. 0 for video and 1 for audio), which is then not used in the demuxer for anything. Those ids are removed.
* mxfdec: Fix some buffer overreads caused by the misuse of AVPacket related ↵Alex Converse2011-10-10
| | | | functions.
* mxfdec: Include FF_INPUT_BUFFER_PADDING_SIZE when allocating extradata.Alex Converse2011-07-29
| | | | This prevents out of bounds reads when extradata is being decoded.
* lavf: use designated initialisers for all (de)muxers.Anton Khirnov2011-07-17
| | | | It's more readable and less prone to breakage.
* Do not include mathematics.h in avutil.hMans Rullgard2011-07-03
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Employ correct printf format specifiers, mostly in debug output.Diego Biurrun2011-05-31
|
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* lavf: replace avio_seek(SEEK_CUR) with avio_skip where it makes senseAnton Khirnov2011-03-16
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>