Commit Graph

296 Commits

Author SHA1 Message Date
Michael Niedermayer
069e462beb Merge commit 'ad8f736b7404503d8f5164f4879175a2258dd64b'
* commit 'ad8f736b7404503d8f5164f4879175a2258dd64b':
  mxf: Remove typo

also See: [FFmpeg-devel] [PATCH 3/3] lavf/mxfdec: delete trailing semi-colon

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-04 02:18:32 +02:00
Luca Barbato
ad8f736b74 mxf: Remove typo
Reported-By: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-04-03 23:45:05 +02:00
Michael Niedermayer
2ef6c0fdf5 Merge commit 'af9481d7019d46c9f18c4ccac77a5d0c54cf6004'
* commit 'af9481d7019d46c9f18c4ccac77a5d0c54cf6004':
  mxf: Lowercase UL strings

Conflicts:
	libavformat/mxfdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-19 21:09:16 +01:00
Michael Niedermayer
8263c14691 Merge commit '842ea36c747eb6537c4236114346cb7a3e9a8df1'
* commit '842ea36c747eb6537c4236114346cb7a3e9a8df1':
  mxf: Override faulty PreviousPartition entries

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-19 20:46:52 +01:00
Luca Barbato
af9481d701 mxf: Lowercase UL strings
The specification uses lower case most of the time.
2014-03-19 12:04:15 +01:00
Luca Barbato
842ea36c74 mxf: Override faulty PreviousPartition entries
Some files set the PreviousPartition field to point to its own offset.

If we are parsing forward the Previous partition is immediately known
and its value could be used, otherwise we can safely point to the
header.

Reported-By: Jean Baptiste Kempf <jb@videolan.org>
2014-03-19 11:56:33 +01:00
Michael Niedermayer
28ee7757f5 Merge commit 'd92024f18fa3d69937cb2575f3a8bf973df02430'
* commit 'd92024f18fa3d69937cb2575f3a8bf973df02430':
  lavf: more correct printf format specifiers

Conflicts:
	libavformat/asfdec.c
	libavformat/cafdec.c
	libavformat/dxa.c
	libavformat/framecrcenc.c
	libavformat/hnm.c
	libavformat/iff.c
	libavformat/mov.c
	libavformat/mxfdec.c
	libavformat/rmdec.c
	libavformat/rpl.c
	libavformat/smacker.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 21:05:34 +01:00
Diego Biurrun
d92024f18f lavf: more correct printf format specifiers 2014-03-11 13:13:41 +01:00
Michael Niedermayer
4c63beeefe Merge commit '8cafeb8bca5d079041739dbd72ccec0ead138eaf'
* commit '8cafeb8bca5d079041739dbd72ccec0ead138eaf':
  mxfdec: Validate parameters to strftime

Conflicts:
	libavformat/mxfdec.c

See: 423089e964
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-10 11:51:40 +01:00
Martin Storsjö
8cafeb8bca mxfdec: Validate parameters to strftime
The MSVCRT version of strftime calls the invalid parameter handler
if the struct values in struct tm are invalid. In case no invalid
parameter handler is set for the process, the process is aborted.

This fixes fate failures on MSVC builds since 570af382.

Based on a patch by Hendrik Leppkes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-03-10 11:11:08 +02:00
Michael Niedermayer
39f5003a07 Merge commit '5b977c1d4fd99f325049d48fb8f0a3240d50eef8'
* commit '5b977c1d4fd99f325049d48fb8f0a3240d50eef8':
  mxf: Return meaningful errors

Conflicts:
	libavformat/mxfdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-06 23:53:36 +01:00
Michael Niedermayer
618d2262d7 Merge commit 'f06f6daaf8538eb8ceeb690b761f1256771b6ba6'
* commit 'f06f6daaf8538eb8ceeb690b761f1256771b6ba6':
  mxf: Parse random index pack

Conflicts:
	libavformat/mxfdec.c

See: f5ed83c383
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-06 23:45:05 +01:00
Michael Niedermayer
5a4852bc4d Merge commit '570af382eea902afe09f3562e5e1b483981cca7e'
* commit '570af382eea902afe09f3562e5e1b483981cca7e':
  mxf: Handle identification metadata

Conflicts:
	libavformat/mxfdec.c

See: 25b143aa7b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-06 22:59:35 +01:00
Michael Niedermayer
3ce8581413 Merge commit '5b930092c3afd2ae01f1c8aa7fb405911d6ad416'
* commit '5b930092c3afd2ae01f1c8aa7fb405911d6ad416':
  mxf: Set audio packets pts

Conflicts:
	libavformat/mxfdec.c

See: 83cab07a4c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-06 22:50:06 +01:00
Luca Barbato
5b977c1d4f mxf: Return meaningful errors 2014-03-06 19:28:20 +01:00
Paul B Mahol
f06f6daaf8 mxf: Parse random index pack
Get the last partition offset and use it when footer partition
offset is missing.

Footer partition may not be present and even if present footer
partition offset may not be set in any partition except last one.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-03-06 19:28:20 +01:00
Matthieu Bouron
570af382ee mxf: Handle identification metadata
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-03-06 19:28:20 +01:00
Matthieu Bouron
5b930092c3 mxf: Set audio packets pts
Extrapolate audio timestamps based on the number of samples demuxed.

Deal with some MXF nastiness involving fractional number of
samples per EditUnit when seeking (the specs handwave this away).

Further fixes from Tomas Härdin.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-03-06 19:28:20 +01:00
Janne Grunau
b37effdc52 mxfdec: free descriptor extradata in .read_close()
Fixes memleak in fate-mxf-demux.
2014-02-09 18:50:53 +01:00
Michael Niedermayer
23e48cd01f Merge commit 'c716624853339ea4b1086a3957b334829370204c'
* commit 'c716624853339ea4b1086a3957b334829370204c':
  mxf: Read field dominance flag

Conflicts:
	libavformat/mxfdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-02 05:23:59 +01:00
Michael Niedermayer
8fb67c1026 Merge commit '7d56f2fffc14ad02001ee0689bee76a759da9ede'
* commit '7d56f2fffc14ad02001ee0689bee76a759da9ede':
  mxf: Handle negative edit_rate

Conflicts:
	libavformat/mxfdec.c

See: 83cab07a4c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-02 05:07:42 +01:00
Matthieu Bouron
c716624853 mxf: Read field dominance flag
And export the information in field_order.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-02-01 16:26:44 +01:00
Luca Barbato
7d56f2fffc mxf: Handle negative edit_rate
Default to 1/25.
2014-02-01 16:25:07 +01:00
Michael Niedermayer
fd334b9b6e avformat/mxfdec: fix typo in error check of mxf_edit_unit_absolute_offset()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-15 18:01:26 +01:00
Michael Niedermayer
e3c0fcadda Merge commit '1a4e4ad0e0c5486dcab05e54b587672a498dd7cf'
* commit '1a4e4ad0e0c5486dcab05e54b587672a498dd7cf':
  mxf: Use av_malloc_array

Conflicts:
	libavformat/mxfdec.c

See: 8ce41721a4
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 22:20:52 +01:00
Michael Niedermayer
d938a013af Merge commit 'aa0cb16c15a5b30f78542f18e3fa65de005cf084'
* commit 'aa0cb16c15a5b30f78542f18e3fa65de005cf084':
  mxf: Fix off by one error in d10 aes3 decoding

Conflicts:
	libavformat/mxfdec.c

See: 3be02afb56
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 21:54:11 +01:00
Michael Niedermayer
1171ad647e Merge commit '42f9132218ca11a8e9a3c82a175b46bca092113e'
* commit '42f9132218ca11a8e9a3c82a175b46bca092113e':
  mxf: Do not use int to check the seek position

Conflicts:
	libavformat/mxfdec.c

See: 007989c7a2
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 21:37:42 +01:00
Tomas Härdin
cc1e3ace63 mxf: Fix potential leak in mxf_read_local_tags()
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-14 18:23:00 +01:00
Luca Barbato
1a4e4ad0e0 mxf: Use av_malloc_array 2014-01-14 18:13:29 +01:00
Tomas Härdin
8b708f1c6b mxf: Correctly support files from Pinnacle Thunder
Such files have IndexTableSegments which when parsed cover EditUnit
ranges like this:

 [0,1)
 [249,250)
 [249,377)
 [0,249)

where each interval is

 [IndexStartPosition, IndexStartPosition + IndexDuration)

This would be reduced to a sparse index like:

 [0,1), [249,250)

instead of the full range:

 [0,249), [249,377)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-14 18:13:29 +01:00
Luca Barbato
f5fbbbc022 mxf: Drop unnecessary checks
av_reallocp_array does the check already.
2014-01-14 18:13:29 +01:00
Michael Niedermayer
0d6605c7ef mxf: Fix a possible leak of extradata
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-14 18:13:29 +01:00
Marton Balint
aa0cb16c15 mxf: Fix off by one error in d10 aes3 decoding
Without this fix the last sample was missing from the packet.
2014-01-14 18:13:22 +01:00
Luca Barbato
42f9132218 mxf: Do not use int to check the seek position
Overly large files are to be expected.

Reported-by: Jean-Baptiste Kempf <jb@videolan.org>
2014-01-14 17:29:03 +01:00
Reimar Döffinger
d84bd4650b mxf: Set AV_FIELD_PROGRESSIVE
Needed for AVC-intra

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-14 17:28:48 +01:00
Michael Niedermayer
4162ceea93 avformat/mxfdec: check avio_read(UID) result
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fc9ba2fd98e_82_02785736.mxf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-10 02:12:30 +01:00
Michael Niedermayer
1c010fd035 avformat/mxfdec: detect loops during header parsing
The header parser uses forward and backward parsing, making the
bulletproof prevention of loops difficult, thus this simple
detection code.
If someone improves the forward/backward parsing so it cannot loop
then this commit should be reverted

Fixes Ticket3278

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 04:55:42 +01:00
Anton Khirnov
95fd52c11b mxfdec: set extradata size
The line setting it was mistakenly removed in
ecf442a58b
2013-11-29 14:19:47 +01:00
Michael Niedermayer
ccdfa3e271 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Add missing #includes for *INT64_MAX and *INT64_C

Conflicts:
	ffmpeg.c
	ffmpeg_filter.c
	ffplay.c
	libavformat/assdec.c
	libavformat/avidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-24 05:21:19 +01:00
Diego Biurrun
8f8bc92365 Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
Michael Niedermayer
074bae745d Merge commit 'ecf442a58b09bdb1dc1d2c3904b82ac5f79b2878'
* commit 'ecf442a58b09bdb1dc1d2c3904b82ac5f79b2878':
  lavf: improve support for AVC-Intra files.

Conflicts:
	libavformat/internal.h
	libavformat/isom.c
	libavformat/mxfdec.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-14 21:04:44 +01:00
Reimar Döffinger
ecf442a58b lavf: improve support for AVC-Intra files.
Generate extradata with SPS/PPS based on container dimensions.

Authors of this commit are: Reimar and Thomas Mundt

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-14 18:59:39 +01:00
Marton Balint
951d819006 mxfdec: update current edit unit when seeking in mxf files without index tables
Fixes audio packet pts values in some files generated by AVID TRMG 3.01.

Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-14 18:59:17 +01:00
Michael Niedermayer
a26e83da6c avformat/mxfdec: optimize probing
about 71 times faster

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-08 22:33:52 +01:00
Paul B Mahol
f5ed83c383 avformat/mxfdec; parse random index pack to get last partition offset and use it when footer partition offset is missing
Footer partition may not be present and even if present footer partition
offset may not be set in any partition except last one.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-10-21 13:29:30 +00:00
Paul B Mahol
a807c68253 avformat: use ff_alloc_extradata()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-10-13 20:13:38 +00:00
Matthieu Bouron
054454c63a mxf: Add jpeg2000 codec to intra only codecs
Conform with SMPTE RP 224 and SMPTE s422.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-10 18:22:46 +02:00
Michael Niedermayer
c28bca2bde Merge commit 'ad0560fe7491a85c3e71d5a3d6a0443f10b33ab1'
* commit 'ad0560fe7491a85c3e71d5a3d6a0443f10b33ab1':
  mxf: Remove a typo

Conflicts:
	libavformat/mxfdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-02 14:55:18 +02:00
Luca Barbato
ad0560fe74 mxf: Remove a typo
Introduced in 93370d1216
2013-10-01 13:43:48 +02:00
Michael Niedermayer
c7fae9081d Merge commit '93370d12164236d59645314871a1d6808b2a8ddb'
* commit '93370d12164236d59645314871a1d6808b2a8ddb':
  mxfdec: set audio timebase to 1/samplerate

Conflicts:
	libavformat/mxfdec.c
	tests/ref/fate/mxf-demux
	tests/ref/seek/lavf-mxf
	tests/ref/seek/lavf-mxf_d10

See: 83cab07a4c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-30 02:12:42 +02:00