Tomas Härdin
edb5085647
mxfdec: Add hack that adjusts the n_delta calculation when system items are present.
...
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
13 years ago
Janne Grunau
682b6db706
mxfdec: Parse IndexTableSegments and convert them into AVIndexEntry arrays.
...
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.
13 years ago
Tomas Härdin
83ab10f6e9
mxfdec: Move FooterPartition to MXFContext and make sure it is never zero.
...
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
13 years ago
Joakim Plate
3359246d9a
mxfdec: check return value of avio_seek
...
Avoid modifying state if avio_seek fails.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
13 years ago
Philip de Nier
0662eea6b0
mxfdec: skip to end of structural sets
...
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>
13 years ago
Tomas Härdin
d32b3f40c7
mxfdec: parse MXF partitions
13 years ago
Tomas Härdin
1de5154dfb
mxfdec: Consider OPAtom files that don't have exactly one EC to be OP1a
...
This fixes demuxing of 2011_DCPTEST_24FPS.V.mxf.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Reimar Döffinger
203f94fd7c
mxfdec: Add missing free.
...
Should fix valgrind FATE.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
13 years ago
Daniel Huang
bcd5d979aa
mov, mxfdec: Employ more meaningful return values.
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
13 years ago
Jean First
d92d2af81f
mxfdec: change av_log formatting %lx to PRIx64 and %li to PRIi64
...
Signed-off-by: Jean First <jeanfirst@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Tomas Härdin
6547fd9264
mxfdec: consider QuantizationBits between 17 and 24 to be pcm_s24*
...
This fixes playback of BRD38772509.mxf.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
13 years ago
Tomas Härdin
cc1dda851b
mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows
13 years ago
Tomas Härdin
0cd21ddaed
mxfdec: Zero nb_ptses in mxf_compute_ptses_fake_index()
...
This fixes SIGSEGV on files with both CBR and VBR index segments (zzuf6.mxf).
13 years ago
Tomas Härdin
46d65fb8a5
mxfdec: Sanity check PreviousPartition
...
Without this certain files could get the demuxer stuck in a loop
13 years ago
Tomas Härdin
e7839602f4
mxfdec: Never seek back in local sets and KLVs
...
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.
13 years ago
Tomas Härdin
184f479096
mxfdec: Move the current_partition check inside mxf_read_header()
...
This fixes SIGSEGV on files where this is actually the case, such as zzuf4.mxf
13 years ago
Tomas Härdin
4ae7d45170
mxfdec: Fix infinite loop in mxf_packet_timestamps()
...
This can happen if an index table segment has a very large IndexStartPosition.
zzuf3.mxf is an example of such a file.
13 years ago
Tomas Härdin
2116e4ba91
mxfdec: Check url_feof() in mxf_read_local_tags()
...
This fixes the infinite loop with zzuf2.mxf
13 years ago
Tomas Härdin
5e5e69d078
mxfdec: Check for NULL component
...
This fixes SIGSEGV with zzuf1.mxf
13 years ago
Tomas Härdin
7feb7f16a8
mxfdec: Make sure mxf->nb_index_tables > 0 in mxf_packet_timestamps()
...
Only the OPAtom demuxing logic is guaranteed to have index tables, meaning OP1a
files that lack an index would cause SIGSEGV.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Tomas Härdin
5b718009b2
mxfdec: Sanity-check SampleRate
...
This avoids a SIGFPE if SampleRate is missing or set to naughty values.
13 years ago
Tomas Härdin
1888bd1b6d
mxfdec: Make sure mxf->nb_index_tables > 0 in mxf_packet_timestamps()
...
Only the OPAtom demuxing logic is guaranteed to have index tables, meaning OP1a
files that lack an index would cause SIGSEGV.
13 years ago
Tomas Härdin
54cbbdd25a
mxfdec: Remove unused variables
13 years ago
Tomas Härdin
6e9081f4d8
mxfdec: Make sure x < index_table->nb_ptses
...
Without this the demuxer will SIGSEGV on files with IndexEntryCount < IndexDuration
13 years ago
Tomas Härdin
085249a379
mxfdec: Ignore the last entry in Avid's index table segments
...
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.
13 years ago
Tomas Härdin
0e764cf541
mxfdec: Don't parse slices or DeltaEntryArrays
...
The most recent demuxing/seeking code doesn't need them
13 years ago
Tomas Härdin
f98726551c
mxfdec: Remove dead/useless code
13 years ago
Tomas Härdin
2eba8da675
mxfdec: Hybrid demuxing/seeking solution
...
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 don't
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.
This fixes ticket #746 .
13 years ago
Tomas Härdin
36c305f9db
mxfdec: Add mxf_edit_unit_absolute_offset()
...
This maps an EditUnit in an index table to the corresponding absolute offset
in the file.
13 years ago
Tomas Härdin
b56adc7842
mxfdec: Replace zero IndexDurations with st->duration
...
The mxf_d10 muxer outputs files with zero IndexDurations..
13 years ago
Tomas Härdin
2212e040b7
mxfdec: Add "fake" index to MXFIndexTable to assist seeking
...
This changes mxf_compute_ptses() to be used for MXFIndexTable, and also adds
code for computing the fake index to it.
This also temporarily disables PTS computation. A future patch will restore it.
13 years ago
Tomas Härdin
8ce41721a4
mxfdec: Add MXFIndexTables
...
This structs collects MXFIndexTableSegments belonging to one IndexSID and some
other bits of useful information.
13 years ago
Tomas Härdin
31029e30fa
mxfdec: Move mxf_read_packet*() near the bottom of the file
...
This simplifies future commits.
13 years ago
Tomas Härdin
7d531e83b6
mxfdec: Set DTS and PTS on video packets
...
This involves computing DTS/PTS from the index tables.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Tomas Härdin
8a2cb2abbf
mxfdec: Only sort IndexTableSegments once
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Tomas Härdin
0bcada9f61
mxfdec: Add Avid's essence element key
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Tomas Härdin
1e14bfc117
mxfdec: Add support for Avid indexes
...
These indexes duplicate every entry and have the total size of the essence
container as the last entry.
This patch also computes the size of the packets when unknown.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Tomas Härdin
89cc8c17df
mxfdec: Check slice_count before freeing slice_offset_entries
...
This fixes SIGSEGV on sliceless (single stream) VBR files
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Tomas Härdin
c0ee522df6
mxfdec: Bring back accumulated_offset that was removed in 5e67e3e
...
I thought it had to do with file offsets, but's actually the offset inside
the essence container.
In other words, unbreak multiple EditUnitByteCounts.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Carl Eugen Hoyos
5207f9597e
Separate mxf_essence_container_uls for audio and video.
...
It is a really bad idea to assign a video codec id
when we have set codec_type to audio and vice versa.
Fixes ticket #721 .
13 years ago
Reimar Döffinger
2483f53693
mxfdec: do not try to use an obviously broken index.
...
Also fixes a memleak.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
13 years ago
Tomas Härdin
ddcf3e0535
mxfdec: Index table driven demuxing and seeking
...
This adds OPAtom support and proper seeking.
D-10 and non-seekable OP1a streams still use the old demuxing/seeking code.
13 years ago
Tomas Härdin
5e67e3eac2
mxfdec: Compute packet offsets properly
...
This replaces the old essence_offset code
13 years ago
Tomas Härdin
5fb800f49a
mxfdec: Use MaterialPackage - Track - TrackID instead of the system_item hack
13 years ago
Tomas Härdin
fd34dbea58
mxfdec: Parse more values in PartitionPack
...
These values include KAGSize, HeaderByteCount and IndexByteCount.
The length of the pack itself is also stored, and KAGSize is sanity checked.
The FATE sample has KAGSize == 0, which is adjusted to 512.
Other bad KAGSizes are set to 1.
13 years ago
Tomas Härdin
7560c26495
mxfdec: Parse TemporalOffsets
13 years ago
Tomas Härdin
623128d782
mxfdec: av_dlog():ify 'no corresponding source package found'
...
This isn't an error. It's also expected behavior for OPAtom files.
13 years ago
Tomas Härdin
336246238e
mxfdec: Compute essence container offsets and lengths into mxf->partitions
13 years ago
Tomas Härdin
289bc14449
mxfdec: Make mxf->partitions sorted by offset
...
This also zeroes new entries for good measure (used by future patches).
13 years ago
Tomas Härdin
e5f9c8927b
mxfdec: Parse ThisPartition
13 years ago