Commit Graph

209 Commits

Author SHA1 Message Date
Philip de Nier
3592bd509c mxfdec: set track edit rate num/den in expected order
This matches the order used for the index table edit rate.

Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-28 20:20:51 +01:00
Michael Niedermayer
8c6ebab747 Merge remote-tracking branch 'qatar/master'
* qatar/master: (26 commits)
  eac3dec: replace undefined 1<<31 with INT32_MIN in noise generation
  yadif: specify array size outside DECLARE_ALIGNED
  prores: specify array size outside DECLARE_ALIGNED brackets.
  WavPack demuxer: set packet duration
  tta: use skip_bits_long()
  mxfdec: Ignore the last entry in Avid's index table segments
  mxfdec: Sanity-check SampleRate
  mxfdec: Handle small EditUnitByteCount
  mxfdec: Consider OPAtom files that do not have exactly one EC to be OP1a
  mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows
  mxfdec: Zero nb_ptses in mxf_compute_ptses_fake_index()
  mxfdec: Sanity check PreviousPartition
  mxfdec: Never seek back in local sets and KLVs
  mxfdec: Move the current_partition check inside mxf_read_header()
  mxfdec: Fix infinite loop in mxf_packet_timestamps()
  mxfdec: Check eof_reached in mxf_read_local_tags()
  mxfdec: Check for NULL component
  mxfdec: Make sure mxf->nb_index_tables > 0 in mxf_packet_timestamps()
  mxfdec: Make sure x < index_table->nb_ptses
  build: Add missing directories to DIRS declarations.
  ...

Conflicts:
	doc/build_system.txt
	doc/fate.texi
	libavfilter/x86/yadif_template.c
	libavformat/mxfdec.c
	libavutil/Makefile
	tests/fate/audio.mak
	tests/fate/prores.mak
	tests/fate/screen.mak
	tests/fate/video.mak
	tests/ref/fate/bethsoft-vid
	tests/ref/fate/cscd
	tests/ref/fate/dfa4
	tests/ref/fate/nuv
	tests/ref/fate/vp8-sign-bias
	tests/ref/fate/wmv8-drm
	tests/ref/lavf/gxf

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-10 01:20:07 +01:00
Tomas Härdin
e24167aae6 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.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 13:26:02 +01:00
Tomas Härdin
d6b81ff949 mxfdec: Sanity-check SampleRate
This avoids a SIGFPE if SampleRate is missing or set to naughty values.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 13:00:05 +01:00
Tomas Härdin
c65642d351 mxfdec: Handle small EditUnitByteCount
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>
2012-02-09 12:59:41 +01:00
Tomas Härdin
240ddbce56 mxfdec: Consider OPAtom files that do not have exactly one EC to be OP1a
This fixes demuxing of 2011_DCPTEST_24FPS.V.mxf.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 12:55:44 +01:00
Tomas Härdin
9123950be0 mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 12:54:14 +01:00
Tomas Härdin
d00257e96a mxfdec: Zero nb_ptses in mxf_compute_ptses_fake_index()
This fixes SIGSEGV on files with both CBR and VBR index segments (zzuf6.mxf).

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 12:54:13 +01:00
Tomas Härdin
df2a85085e mxfdec: Sanity check PreviousPartition
Without this certain files could get the demuxer stuck in a loop.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 12:54:05 +01:00
Tomas Härdin
11800c8c89 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.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 12:46:12 +01:00
Tomas Härdin
687e2fdebd mxfdec: Move the current_partition check inside mxf_read_header()
This fixes SIGSEGV on files where this is the case, such as zzuf4.mxf.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 12:43:47 +01:00
Tomas Härdin
e352c96c17 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.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 12:42:59 +01:00
Tomas Härdin
0373ec635d mxfdec: Check eof_reached in mxf_read_local_tags()
This fixes an infinite loop with zzuf2.mxf.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 12:41:50 +01:00
Tomas Härdin
effe3b9575 mxfdec: Check for NULL component
This fixes a SIGSEGV with zzuf1.mxf.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 12:41:50 +01:00
Tomas Härdin
29fc8f50cd 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: Diego Biurrun <diego@biurrun.de>
2012-02-09 12:41:42 +01:00
Tomas Härdin
a3923482f2 mxfdec: Make sure x < index_table->nb_ptses
Avoids a SIGSEGV on files with IndexEntryCount < IndexDuration.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-09 12:40:34 +01:00
Michael Niedermayer
e37f161e66 Merge remote-tracking branch 'qatar/master'
* qatar/master: (71 commits)
  movenc: Allow writing to a non-seekable output if using empty moov
  movenc: Support adding isml (smooth streaming live) metadata
  libavcodec: Don't crash in avcodec_encode_audio if time_base isn't set
  sunrast: Document the different Sun Raster file format types.
  sunrast: Add a check for experimental type.
  libspeexenc: use AVSampleFormat instead of deprecated/removed SampleFormat
  lavf: remove disabled FF_API_SET_PTS_INFO cruft
  lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft
  lavf: remove disabled FF_API_REORDER_PRIVATE cruft
  lavf: remove disabled FF_API_SEEK_PUBLIC cruft
  lavf: remove disabled FF_API_STREAM_COPY cruft
  lavf: remove disabled FF_API_PRELOAD cruft
  lavf: remove disabled FF_API_NEW_STREAM cruft
  lavf: remove disabled FF_API_RTSP_URL_OPTIONS cruft
  lavf: remove disabled FF_API_MUXRATE cruft
  lavf: remove disabled FF_API_FILESIZE cruft
  lavf: remove disabled FF_API_TIMESTAMP cruft
  lavf: remove disabled FF_API_LOOP_OUTPUT cruft
  lavf: remove disabled FF_API_LOOP_INPUT cruft
  lavf: remove disabled FF_API_AVSTREAM_QUALITY cruft
  ...

Conflicts:
	doc/APIchanges
	libavcodec/8bps.c
	libavcodec/avcodec.h
	libavcodec/libx264.c
	libavcodec/mjpegbdec.c
	libavcodec/options.c
	libavcodec/sunrast.c
	libavcodec/utils.c
	libavcodec/version.h
	libavcodec/x86/h264_deblock.asm
	libavdevice/libdc1394.c
	libavdevice/v4l2.c
	libavformat/avformat.h
	libavformat/avio.c
	libavformat/avio.h
	libavformat/aviobuf.c
	libavformat/dv.c
	libavformat/mov.c
	libavformat/utils.c
	libavformat/version.h
	libavformat/wtv.c
	libavutil/Makefile
	libavutil/file.c
	libswscale/x86/input.asm
	libswscale/x86/swscale_mmx.c
	libswscale/x86/swscale_template.c
	tests/ref/lavf/ffm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-28 07:53:34 +01:00
Anton Khirnov
6e9651d106 lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Michael Niedermayer
01fcbdf9ce Merge remote-tracking branch 'qatar/master'
* qatar/master:
  smacker: Sanity check huffman tables found in the headers.
  smacker: remove dead store
  qdm2: Check data block size for bytes to bits overflow.
  mxfdec: Fix files with essence containers larger than 2 GiB.
  mxfdec: Employ correct printf conversion specifiers for POSIX int types.
  vc1: always read the bfraction element for interlaced fields
  fate: add XWD image regression test
  lavf: prevent infinite loops while flushing in avformat_find_stream_info
  matroskadec: Pad AAC extradata.
  ismindex: Fix build on mingw

Conflicts:
	libavformat/mxfdec.c
	libavformat/utils.c
	tests/lavf-regression.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-27 02:09:58 +01:00
Tomas Härdin
62271c4c9a mxfdec: Fix files with essence containers larger than 2 GiB.
For such files, accumulating into an int would cause an overflow.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-01-26 15:47:50 +01:00
Jean First
4fbd3e89e7 mxfdec: Employ correct printf conversion specifiers for POSIX int types.
Signed-off-by: Jean First <jeanfirst@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-01-26 15:31:55 +01:00
Tomas Härdin
b720915be1 mxfdec: Fix files > 2 GiB
Accumulating into an int would cause overflow for files with essence
containers larger than 2 GiB.
2012-01-24 12:42:32 +01:00
Tomas Härdin
d8531a1c18 mxfdec: Handle small EditUnitByteCount
These are common with audio atoms. Without this the demuxer would read two
bytes at a time for a mono 16-bit file.
2012-01-24 11:36:39 +01:00
Janne Grunau
50a3f9a4bd mxfdec: fix memleak on mxf_read_close() 2012-01-23 17:29:58 +01:00
Michael Niedermayer
feb997577b Merge remote-tracking branch 'qatar/master'
* qatar/master: (25 commits)
  riff: fix invalid av_freep() calls on EOF in ff_read_riff_info
  pam: Fix a typo that broke writing and reading PAM files.
  mxfdec: fix memleak on av_realloc failures
  mxfdec: Do not parse slices or DeltaEntryArrays.
  mxfdec: hybrid demuxing/seeking solution
  mxfdec: Add Avid's essence element key.
  mfxdec: Separate mxf_essence_container_uls for audio and video.
  mxfdec: Compute packet offsets properly.
  mxfdec: Use MaterialPackage - Track - TrackID instead of the system_item hack.
  mxfdec: use av_dlog() for 'no corresponding source package found'
  mxfdec: Make mxf->partitions sorted by offset.
  mxfdec: parse ThisPartition
  mxfdec: Speed up metadata and index parsing.
  mxfdec: Make sure DataDefinition is consistent between material track and source track.
  mxfdec: add EssenceContainer UL found in 0001GL00.MXF.A1.mxf_opatom.mxf
  mxfdec: Add hack that adjusts the n_delta calculation when system items are present.
  mxfdec: Parse IndexTableSegments and convert them into AVIndexEntry arrays.
  mxfdec: Move FooterPartition to MXFContext and make sure it is never zero.
  mxfdec: check return value of avio_seek
  mxfdec: skip to end of structural sets
  ...

Conflicts:
	configure
	libavcodec/pnm.c
	libavformat/mxfdec.c
	libavformat/riff.c
	libavformat/rtsp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-23 01:05:20 +01:00
Janne Grunau
20ea14d0f8 mxfdec: fix memleak on av_realloc failures 2012-01-22 14:47:11 +01:00
Tomas Härdin
fc85729458 mxfdec: Do not parse slices or DeltaEntryArrays.
The most recent demuxing/seeking code does not need them.
2012-01-22 14:40:54 +01:00
Janne Grunau
f028d4d1c3 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
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.
2012-01-22 14:40:53 +01:00
Tomas Härdin
1f5f8b2654 mxfdec: Add Avid's essence element key.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Carl Eugen Hoyos
44deb9f68d mfxdec: 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.

Prevents detection of mp2 in mxf as mpeg2video.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
3cb33fbe91 mxfdec: Compute packet offsets properly.
This replaces the old essence_offset code.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
f4187945a0 mxfdec: Use MaterialPackage - Track - TrackID instead of the system_item hack.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
21cc4b3327 mxfdec: use av_dlog() for 'no corresponding source package found'
This is not an error and expected behavior for OPAtom files.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
c77a5460b1 mxfdec: Make mxf->partitions sorted by offset.
This also zeroes new entries for good measure (used by future patches).

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
be78e3f6ec mxfdec: parse ThisPartition
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
775d3b4ab1 mxfdec: Speed up metadata and index parsing.
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>
2012-01-22 14:40:52 +01:00
Tomas Härdin
0999151962 mxfdec: Make sure DataDefinition is consistent between material track and 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>
2012-01-22 14:40:52 +01:00
Tomas Härdin
0ac5e6a8c4 mxfdec: add EssenceContainer UL found in 0001GL00.MXF.A1.mxf_opatom.mxf
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:52 +01:00
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>
2012-01-22 14:40:52 +01:00
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.
2012-01-22 14:40:52 +01:00
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>
2012-01-22 14:40:52 +01:00
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>
2012-01-22 14:40:52 +01:00
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>
2012-01-22 14:40:52 +01:00
Tomas Härdin
d32b3f40c7 mxfdec: parse MXF partitions 2012-01-22 14:40:51 +01:00
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>
2012-01-17 20:55:19 +01:00
Reimar Döffinger
203f94fd7c mxfdec: Add missing free.
Should fix valgrind FATE.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-01-16 19:21:24 +01:00
Michael Niedermayer
4a4c4278b7 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  fate: split ADPCM and DPCM test references into separate files.
  mov, mxfdec: Employ more meaningful return values.
  lavc: Relax API strictness in avcodec_decode_audio3 with a custom get_buffer()
  wavpack: fix clipping for 32-bit lossy mode
  vb: Use bytestream2 functions

Conflicts:
	libavcodec/utils.c
	libavcodec/vb.c
	libavformat/mxfdec.c
	tests/fate/dpcm.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-16 01:33:35 +01:00
Daniel Huang
bcd5d979aa mov, mxfdec: Employ more meaningful return values.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-01-15 22:00:11 +01:00
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>
2012-01-01 21:15:46 +01:00
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>
2011-12-21 16:28:42 +01:00
Tomas Härdin
cc1dda851b mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows 2011-12-21 14:18:08 +01:00
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).
2011-12-21 14:18:08 +01:00
Tomas Härdin
46d65fb8a5 mxfdec: Sanity check PreviousPartition
Without this certain files could get the demuxer stuck in a loop
2011-12-21 14:17:44 +01:00
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.
2011-12-21 14:17:29 +01:00
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
2011-12-21 14:16:03 +01:00
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.
2011-12-21 14:16:03 +01:00
Tomas Härdin
2116e4ba91 mxfdec: Check url_feof() in mxf_read_local_tags()
This fixes the infinite loop with zzuf2.mxf
2011-12-21 14:15:51 +01:00
Tomas Härdin
5e5e69d078 mxfdec: Check for NULL component
This fixes SIGSEGV with zzuf1.mxf
2011-12-21 13:48:39 +01:00
Tomas Härdin
5b718009b2 mxfdec: Sanity-check SampleRate
This avoids a SIGFPE if SampleRate is missing or set to naughty values.
2011-12-20 11:34:48 +01:00
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.
2011-12-20 11:32:59 +01:00
Tomas Härdin
54cbbdd25a mxfdec: Remove unused variables 2011-12-20 09:59:29 +01:00
Tomas Härdin
6e9081f4d8 mxfdec: Make sure x < index_table->nb_ptses
Without this the demuxer will SIGSEGV on files with IndexEntryCount < IndexDuration
2011-12-20 09:58:37 +01:00
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.
2011-12-20 09:18:44 +01:00
Tomas Härdin
0e764cf541 mxfdec: Don't parse slices or DeltaEntryArrays
The most recent demuxing/seeking code doesn't need them
2011-12-16 11:54:08 +01:00
Tomas Härdin
f98726551c mxfdec: Remove dead/useless code 2011-12-16 11:54:07 +01:00
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.
2011-12-16 11:54:03 +01:00
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.
2011-12-16 11:48:02 +01:00
Tomas Härdin
b56adc7842 mxfdec: Replace zero IndexDurations with st->duration
The mxf_d10 muxer outputs files with zero IndexDurations..
2011-12-16 11:48:02 +01:00
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.
2011-12-16 11:45:40 +01:00
Tomas Härdin
8ce41721a4 mxfdec: Add MXFIndexTables
This structs collects MXFIndexTableSegments belonging to one IndexSID and some
other bits of useful information.
2011-12-16 11:32:52 +01:00
Tomas Härdin
31029e30fa mxfdec: Move mxf_read_packet*() near the bottom of the file
This simplifies future commits.
2011-12-16 11:32:52 +01:00
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>
2011-12-12 18:34:37 +01:00
Tomas Härdin
8a2cb2abbf mxfdec: Only sort IndexTableSegments once
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-12 18:34:37 +01:00
Tomas Härdin
0bcada9f61 mxfdec: Add Avid's essence element key
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-12 18:34:37 +01:00
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>
2011-12-12 18:34:37 +01:00
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>
2011-12-12 18:34:37 +01:00
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>
2011-12-12 18:34:37 +01:00
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.
2011-12-10 14:58:57 +01:00
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>
2011-12-10 13:19:24 +01:00
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.
2011-12-08 20:28:49 +01:00
Tomas Härdin
5e67e3eac2 mxfdec: Compute packet offsets properly
This replaces the old essence_offset code
2011-12-08 19:13:18 +01:00
Tomas Härdin
5fb800f49a mxfdec: Use MaterialPackage - Track - TrackID instead of the system_item hack 2011-12-08 19:11:57 +01:00
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.
2011-12-08 19:11:16 +01:00
Tomas Härdin
7560c26495 mxfdec: Parse TemporalOffsets 2011-12-08 18:19:48 +01:00
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.
2011-12-08 18:19:48 +01:00
Tomas Härdin
336246238e mxfdec: Compute essence container offsets and lengths into mxf->partitions 2011-12-08 18:19:44 +01:00
Tomas Härdin
289bc14449 mxfdec: Make mxf->partitions sorted by offset
This also zeroes new entries for good measure (used by future patches).
2011-12-08 11:06:23 +01:00
Tomas Härdin
e5f9c8927b mxfdec: Parse ThisPartition 2011-12-07 17:43:36 +01:00
Tomas Härdin
dcd30b83b4 mxfdec: Speed up metadata and index parsing
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 aren't needlessly
parsed. This speeds up parsing large files a lot.
2011-12-07 17:22:02 +01:00
Tomas Härdin
e1914b5a2f mxfdec: Make sure DataDefinition is consistent between material track and 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.
2011-12-07 16:26:09 +01:00
Tomas Härdin
1170749b39 mxfdec: Add EssenceContainer UL found in 0001GL00.MXF.A1.mxf_opatom.mxf 2011-12-07 16:26:09 +01:00
Michael Niedermayer
9d76cf0b18 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtpdec: Templatize the code for different g726 bitrate variants
  rv40: move loop filter to rv34dsp context
  lavf: make av_set_pts_info private.
  rtpdec: Add support for G726 audio
  rtpdec: Add an init function that can do custom codec context initialization
  avconv: make copy_tb on by default.
  matroskadec: don't set codec timebase.
  rmdec: don't set codec timebase.
  avconv: compute next_pts from input packet duration when possible.
  lavf: estimate frame duration from r_frame_rate.
  avconv: update InputStream.pts in the streamcopy case.

Conflicts:
	avconv.c
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/fbdev.c
	libavdevice/libdc1394.c
	libavdevice/oss_audio.c
	libavdevice/v4l.c
	libavdevice/v4l2.c
	libavdevice/vfwcap.c
	libavdevice/x11grab.c
	libavformat/au.c
	libavformat/eacdata.c
	libavformat/flvdec.c
	libavformat/mpegts.c
	libavformat/mxfenc.c
	libavformat/rtpdec_g726.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-01 02:54:24 +01:00
Anton Khirnov
c3f9ebf743 lavf: make av_set_pts_info private.
It's supposed to be called only from (de)muxers.
2011-11-30 20:34:45 +01:00
Tomas Härdin
fd1cea6549 mxfdec: Add hack that adjusts the n_delta calculation when system items are present
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-18 15:33:44 +01:00
Tomas Härdin
7ddb0607f3 mxfdec: Parse IndexTableSegments and convert them into AVIndexEntry arrays
Based on work by Georg Lippitsch <georg.lippitsch@gmx.at>

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-18 15:33:36 +01:00
Clément Bœsch
eef3ea8c71 Rename remaining ByteIOContext to AVIOContext. 2011-11-14 07:22:30 +01:00
Michael Niedermayer
4354788a89 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  tls: Use ERR_get_error() in do_tls_poll
  indeo3: Fix a fencepost error.
  mxfdec: Fix comparison of unsigned expression < 0.
  mpegts: set stream id on just created stream, not an unrelated variable
  ra288: return error if input buffer is too small
  ra288: utilize DSPContext.vector_fmul()
  ra288: use memcpy() to copy decoded samples to output
  mace: only calculate output buffer size once
  Remove redundant filename self-references inside files.
  indeo3data: add missing config.h #include for HAVE_BIGENDIAN
  x86: drop pointless ARCH_X86 #ifdef from files in x86 subdirectory
  avplay: reset rdft when closing stream.
  doc/git-howto: expand format-patch and send-email notes.
  lavf: expand doxy for some AVFormatContext fields.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-09 02:59:49 +01:00
Alex Converse
735e601be1 mxfdec: Fix comparison of unsigned expression < 0.
'size' is populated by functions returning int64_t and int that return
negative error codes.
2011-11-08 10:59:52 -08:00
Michael Niedermayer
6faf0a21e1 Merge remote-tracking branch 'qatar/master'
* qatar/master: (53 commits)
  probe: Restore identification of files with very large id3 tags and no extension.
  probe: Remove id3 tag presence as a criteria to do file extension checking.
  mpegts: MP4 SL support
  mpegts: MP4 OD support
  mpegts: Add support for Sections in PMT
  mpegts: Replace the MP4 descriptor parser with a recursive parser.
  mpegts: Add support for multiple mp4 descriptors
  mpegts: Parse mpeg2 SL descriptors.
  isom: Add MPEG4SYSTEMS dummy object type indication.
  aacdec: allow output reconfiguration on channel changes
  nellymoserenc: take float input samples instead of int16
  nellymoserdec: use dsp functions for overlap and windowing
  nellymoserdec: do not fail if there is extra data in the packet
  nellymoserdec: fail if output buffer is too small
  nellymoserdec: remove pointless buffer size check.
  lavf: add init_put_byte() to the list of visible symbols.
  seek-test: free options dictionary after use
  snow: do not draw_edge if emu_edge is set
  tools/pktdumper: update to recent avformat api
  seek-test: update to recent avformat api
  ...

Conflicts:
	doc/APIchanges
	libavcodec/mpegaudiodec.c
	libavcodec/nellymoserdec.c
	libavcodec/snow.c
	libavcodec/version.h
	libavcodec/wmadec.c
	libavformat/avformat.h
	libavformat/mpegts.c
	libavformat/mxfdec.c
	libavformat/utils.c
	libavformat/wtv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-29 02:08:54 +02:00
Anton Khirnov
a2faa95151 lavf: make some seeking functions private
Specifically av_update_cur_dts(), av_seek_frame_binary() and
av_gen_search().

They are not supposed to be called outside lavf.
2011-10-28 09:23:24 +02:00