Commit Graph

964 Commits

Author SHA1 Message Date
Michael Niedermayer e21235f9b9 avformat/mov: call mov_rewrite_dvd_sub_extradata() after parsing dimensions from tkhd
This also moves mov_rewrite_dvd_sub_extradata() to mov.c

Fixes: NeroRecodeSample.mp4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 18:36:25 +01:00
Michael Niedermayer 8ba432bc56 avformat/mov: fill in subtitle dimensions after parsing tkhd
Sample: NeroRecodeSample.mp4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-17 18:21:11 +01:00
Peter Ross dadf668df2 avformat/mov: decode compilation metadata
This flag is known as 'Part of a compilation' in Apple iTunes.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 04:28:58 +01:00
Michael Niedermayer 3ddf76ee07 Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
  Revert "Allow stream-copying grayscale mov files."

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 12:20:06 +01:00
Michael Niedermayer 1f36ebf63a avformat: revert %c changes from d92024f18f
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 05:09:28 +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
Carl Eugen Hoyos 54bbe3e2a6 Revert "Allow stream-copying grayscale mov files."
This reverts commit 691dec6201.

The commit did not fix ticket #3215, it was fixed one commit earlier.
The revert may break other use-cases but they should be fixed differently,
the offending commit introduced too many problems.

Fixes ticket #3377.
Fixes ticket #3378.
2014-03-11 20:09:07 +01:00
Diego Biurrun d92024f18f lavf: more correct printf format specifiers 2014-03-11 13:13:41 +01:00
Baptiste Coudurier 9e71cc81f3 movdec: handle 0x7fff langcode as macintosh per the specs
The correct point that seperates ISO and MAC language codes is 0x400
according to the current QT spec. Old QT specs did not list where this
seperation is but apparently only defined the meaning of the first 137.
2014-03-09 18:09:39 +01:00
Michael Niedermayer 622d24e4eb avformat/mov: simplify code setting needs_parsing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-27 13:52:55 +01:00
Carl Eugen Hoyos 5d6fac114b Support old qclp-in-mov files that do not store bytes_per_frame in the header.
Fixes ticket #2649.
2014-02-23 00:41:53 +01:00
Michael Niedermayer 0c803eba2f avformat/mov: make invalid sampledelta error more verbose
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-20 18:04:44 +01:00
Michael Niedermayer 05e9e3342f avformat/mov: fix avg_frame_rate calculation
Fixes integer overflow
Fixes Ticket3390

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-16 19:05:49 +01:00
Michael Niedermayer a0911b0597 avformat/mov: fix keyframe flags for sample from chromium Issue 340865
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-12 06:42:04 +01:00
Michael Niedermayer 28bc1d94b7 avformat/mov: redesign the fps calculation
This uses STTS and TRUN information to calculate the fps
It seems to work with more files than the previous code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-22 00:33:38 +01:00
Michael Niedermayer 8e5e84c2a2 avformat/mov: Ignore the last frame for duration and fps calculation if it looks suspect
The used heuristic will potentially need to be finetuned
Fixes daemon404s fps.mov

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-21 19:48:05 +01:00
Justin Ruggles d01e684186 mov: do not set avg_frame_rate in the demuxer
The track duration is often not reliable or is not the duration
represented by the number of frames. In those cases, avg_frame_rate
was reported incorrectly. Removing this code falls back to the
default calculation in avformat_find_stream_info().

This is a partial revert of commit c3aeaa540.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-01-20 19:15:36 +00:00
Michael Niedermayer fb37d03a87 Merge commit '2620df13104ddaa136158eb6bb1195adbf9d7692'
* commit '2620df13104ddaa136158eb6bb1195adbf9d7692':
  mov: Free an earlier allocated array if allocating a new one

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-15 14:13:17 +01:00
Michael Niedermayer 04cc753d07 Merge commit 'd51f09962d5b4bc999fb70c040f330dd1873212e'
* commit 'd51f09962d5b4bc999fb70c040f330dd1873212e':
  mov: Free intermediate arrays in the normal cleanup function

Conflicts:
	libavformat/mov.c

See: a6b3e6d0b4
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-15 14:06:27 +01:00
Martin Storsjö 2620df1310 mov: Free an earlier allocated array if allocating a new one
It could probably also be considered an error if the pointer isn't
null at this point, but then we might risk rejecting some
slightly broken files that we might have handled so far.

Sample-Id: 00000496-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-15 09:57:38 +02:00
Martin Storsjö d51f09962d mov: Free intermediate arrays in the normal cleanup function
These arrays are normally freed at the end of mov_read_trak,
but make sure they're freed in case mov_read_trak returned
early (due to errors) or in case the atoms that allocate arrays
are encountered at some other point than within a trak (which
we don't have checks against).

Sample-Id: 00000496-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-15 09:57:26 +02:00
Michael Niedermayer b2ae92110f avcodec/flashsv: check avio_read() return in mov_read_udta_string()
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f3f90a8606a_3018_Sequence_1-Apple_ProRes_422_LT.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-14 18:35:14 +01:00
Michael Niedermayer 8efde6d80c avformat/mov: clear padding area in mov_read_extradata()
Fixes: msan_uninit-mem_7f58816b71e3_7025_mov_svq3___svq3_weird_prediction2.mov
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-28 03:42:40 +01:00
Michael Niedermayer 4156df59f5 avformat/mov: check avio_read() return in mov_read_dref()
Fixes: msan_uninit-mem_7f4960453a02_7264_mr_cork_jpeg.mov
Fixes use of uninitialized memory
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-27 23:37:17 +01:00
Michael Niedermayer 3e5a7dffe8 avformat/mov: use ff_get_extradata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-25 17:38:29 +01:00
Michael Niedermayer 2a5fb0b13e avformat/mov: check avio_read return in mov_read_dvc1()
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f46d5199ee1_9456_vc1-wmapro.ism
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-25 14:55:28 +01:00
Carl Eugen Hoyos 691dec6201 Allow stream-copying grayscale mov files.
This reverts 0de2157f / r12272.
Fixes ticket #3215.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-24 22:22:16 +01:00
Carl Eugen Hoyos d63e994361 avformat/mov: Do not compute a grayscale palette for cinepak in mov.
This was never done for avi files, the decoder always produced
output no matter if a palette was computed or not.
Since a non-standard palette was needed, this simplifies the code.
See issue 1067 and ticket #165.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-24 22:22:06 +01:00
Michael Niedermayer 7a5d3a41fe avformat/mov: Check avio_read() return code in mov_read_extradata() and shrink the extradata if needed / return an error
Fixes use of uninitialized data
Fixes: msan_uninit-mem_7ff57193e77e_2715_RAW512K_Stream_004.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-15 00:16:53 +01:00
Michael Niedermayer ba189b1db4 avformat/mov: use rfps_add_frame() only for video
it makes no sense for other streams

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-07 03:23:49 +01:00
Michael Niedermayer e2bf00ce46 avformat/mov: calculate rfps from the first 100 frames of the index
This reduces the amount of frames that need to be demuxed in av_find_stream_info()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-05 17:46:40 +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 a7f27453f6 avformat/mov: Check that we have a stream before accessing it in mov_read_ares()
Fixes out of array read
Fixes: signal_sigsegv_6f1855_3910_avid_test_alpha.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-22 22:04:03 +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
Hendrik Leppkes 019247bdc3 avformat/mov: only force parsing for video tracks if stss is empty
Fixes playback of some AAC streams, which are otherwise mangled by the
parser, and stss is typically only valid for video anyway.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-08 11:31:02 +01:00
Yusuke Nakamura ea29f965dc mov: Support HEVC demuxing
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-31 20:20:32 +01:00
Michael Niedermayer f58cb772d9 avformat/mov: fix "correctly" typo
Found-by: Timothy Gu
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-16 00:26:10 +02:00
Yusuke Nakamura 53f903b7c5 lavf/mov: Support HEVC demuxing.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-16 00:17:28 +02: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
Michael Niedermayer a7630e3755 Merge commit 'b698542ad83284fbb8c22404e3cafeb2dd739d38'
* commit 'b698542ad83284fbb8c22404e3cafeb2dd739d38':
  mov: Don't allocate arrays with av_malloc that will be realloced

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-05 10:50:47 +02:00
Martin Storsjö b698542ad8 mov: Don't allocate arrays with av_malloc that will be realloced
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-05 00:00:43 +03:00
Michael Niedermayer e41ea866fc avformat/mov: force parsing of headers if stts is absent
Fixes Ticket2991

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-04 17:47:26 +02:00
Michael Niedermayer ebb8dd437b mov: fix trun / pseudo_stream_id handling
This fixes simple concatenated h264

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-02 19:59:10 +02:00
Michael Niedermayer 143a19f5c7 Merge commit 'c231987662194d009dd91bfc57c678e0e70ca161'
* commit 'c231987662194d009dd91bfc57c678e0e70ca161':
  mov: Make sure the read sample count is nonnegative

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-30 00:32:01 +02:00
Martin Storsjö c231987662 mov: Make sure the read sample count is nonnegative
This avoids setting a negative number of frames, ending up with a
negative average frame rate.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 20:00:45 +03:00
Martin Storsjö d872fb0f7f lavf: Reset the entry count and allocation size variables on av_reallocp failures
When av_reallocp fails, the associated variables that keep track of
the number of elements in the array (and in some cases, the
separate number of allocated elements) need to be reset.

Not all of these might technically be needed, but it's better to
reset them if in doubt, to make sure variables don't end up
conflicting.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-26 23:14:03 +03:00
Michael Niedermayer a5cbf1991c avformat/mov: reset extradata size when extradata gets deallocated due to realloc failure
This prevents the fields from becoming inconsistent

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-22 16:11:02 +02:00
Michael Niedermayer 20dfab33f5 Merge commit '5626f994f273af80fb100d4743b963304de9e05c'
* commit '5626f994f273af80fb100d4743b963304de9e05c':
  avformat: Use av_reallocp() where suitable

Conflicts:
	libavformat/avidec.c
	libavformat/avienc.c
	libavformat/aviobuf.c
	libavformat/oggparsevorbis.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-19 11:01:26 +02:00