1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

1304 Commits

Author SHA1 Message Date
Michael Niedermayer
15629129dd avformat/mov: Fix deallocation when MOVStreamContext failed to allocate
Fixes: 260813283176b57b3c9974fe284eebc3_signal_sigsegv_7ffff713351a_991_xtrem_e2_m64q15_a32sxx.3gp with memlimit of 262144

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-14 14:15:42 +02:00
Michael Niedermayer
488cc05192 avformat/mov: Use ff_configure_buffers_for_index()
Fixes Ticket2513
Fixes Ticket4432

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-13 12:38:21 +02:00
Michael Niedermayer
ba77fb61f7 Merge commit 'd80811c94e068085aab797f9ba35790529126f85'
* commit 'd80811c94e068085aab797f9ba35790529126f85':
  riff: Use the correct logging context

Conflicts:
	libavformat/asfdec_o.c
	libavformat/avidec.c
	libavformat/dxa.c
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/riff.h
	libavformat/riffdec.c
	libavformat/wavdec.c
	libavformat/wtvdec.c
	libavformat/xwma.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-12 15:22:37 +02:00
Luca Barbato
d80811c94e riff: Use the correct logging context 2015-07-11 18:45:44 +02:00
Michael Niedermayer
55a04a5d7a Merge commit 'a1e2caa93e4f8102666a21222f01b74838b6497f'
* commit 'a1e2caa93e4f8102666a21222f01b74838b6497f':
  mov: Log format rather than fourcc in stsd in trace mode

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-01 04:15:27 +02:00
Michael Niedermayer
35c8dda5c2 Merge commit '2eef75fd7e1ac96ab9ca63bb4523078c908bc9b1'
* commit '2eef75fd7e1ac96ab9ca63bb4523078c908bc9b1':
  mov: Adjust variable types to fix format warnings

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-01 04:06:42 +02:00
Vittorio Giovara
a1e2caa93e mov: Log format rather than fourcc in stsd in trace mode
This will fix remaining format warnings.
2015-07-01 00:13:58 +01:00
Vittorio Giovara
2eef75fd7e mov: Adjust variable types to fix format warnings 2015-07-01 00:13:58 +01:00
Michael Niedermayer
ae215e2b42 Merge commit '6ec688e1bc76dd93151cbca1c340162ae4b10d77'
* commit '6ec688e1bc76dd93151cbca1c340162ae4b10d77':
  mp3: enable packed main_data decoding in MP4

Conflicts:
	libavcodec/mpegaudiodec_template.c

Only the parts needed to support the available sample are merged
the remaining error checks are left in place

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-21 20:32:06 +02:00
nu774
6ec688e1bc mp3: enable packed main_data decoding in MP4
14496-3 suggests packing main_data of MP3 that is usually scattered
into multiple frames due to bit reservoir.

However, after packing main_data into a access unit, bitrate index
in the MPEG audio frame header doesn't match with actual frame size.

In order to accept this, this patch removes unnecessary frame size
checking on mp3 decoder.

Also, mov demuxer was changed to use MP3 parser only on special cases
(QT MOV with specific sample description) to avoid re-packetizing.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-06-20 12:18:01 +03:00
Michael Niedermayer
3d6635749a Merge commit '6308cd4868d2bd5fdf8bfa8dd10856c9a91874f5'
* commit '6308cd4868d2bd5fdf8bfa8dd10856c9a91874f5':
  mov: Check memory allocation

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-08 22:56:51 +02:00
Vittorio Giovara
6308cd4868 mov: Check memory allocation
CC: libav-stable@libav.org
Bug-Id: CID 1292518
2015-06-08 13:03:39 +01:00
Michael Niedermayer
9614df4b15 avformat/mov: Retry same packet on IO failure to avoid loosing a packet
Based on patch by: Zhang Rui <bbcallen@gmail.com>
Reviewed-by: Zhang Rui <bbcallen@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-03 17:37:09 +02:00
Michael Niedermayer
9e1cdfb89b Merge commit '5c720657c23afd798ae0db7c7362eb859a89ab3d'
* commit '5c720657c23afd798ae0db7c7362eb859a89ab3d':
  mov: always check avio_read return value

Conflicts:
	libavformat/mov.c

See: b71528d896
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 00:59:44 +02:00
Michael Niedermayer
348319f543 Merge commit 'a8a90906fb0ad0f8d3c68a97f182528ee3b5198c'
* commit 'a8a90906fb0ad0f8d3c68a97f182528ee3b5198c':
  mov: Correctly allocate ctts_data

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 00:35:39 +02:00
Andreas Cadhalpun
5c720657c2 mov: always check avio_read return value
If avio_read fails, the buffer can contain uninitialized data.

This fixes 'Conditional jump or move depends on uninitialised value(s)'
valgrind warnings, and addresses a few memleaks.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-05-31 13:05:13 +02:00
Luca Barbato
a8a90906fb mov: Correctly allocate ctts_data
It can be reallocated.

CC: libav-stable@libav.org
2015-05-31 13:05:12 +02:00
Andreas Cadhalpun
cffb9ea81b mov: reject zero bytes_per_frame with non-zero samples_per_frame
In this case the mov demuxer can return a large number of empty packets.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-05-31 13:05:12 +02:00
Andreas Cadhalpun
f261a55d72 mov: Fix two memleaks
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

CC: libav-stable@libav.org
2015-05-31 13:05:12 +02:00
Michael Niedermayer
08b7d19def avformat/mov: Also export loci altitude
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-30 15:28:31 +02:00
Michael Niedermayer
1607f77494 avformat/mov: Append place name instead of overwriting for loci
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-30 15:23:19 +02:00
Andreas Cadhalpun
153639cb9c mov: fix DTS calculation for samples with negative stts duration
A negative sample duration is invalid according to the spec, but there
are samples that use it for the DTS calculation, e.g.:
http://files.1f0.de/samples/mp4-negative-stts-problem.mp4

These currently get out of A/V sync.

Also change the logging type to AV_LOG_WARNING, because decoding the
sample can continue.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-29 19:35:58 +02:00
Michael Niedermayer
e1b0019568 avformat/mov: Avoid float usage in yuv_to_rgba()
This avoids the possibility for rounding/precision differences between platforms

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-29 12:16:08 +02:00
Andreas Cadhalpun
83a04f8cc1 mov: reject zero bytes_per_frame with non-zero samples_per_frame
In this case the mov demuxer can return a large number of empty packets.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-26 00:28:02 +02:00
Michael Niedermayer
8ce564ea28 avformat/mov: Mark avio context of decompressed atoms as seekable
Fixes Ticket4329

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-25 01:26:55 +02:00
Andreas Cadhalpun
b71528d896 mov: always check avio_read return value
If avio_read fails, the buffer can contain uninitialized data.

This fixes 'Conditional jump or move depends on uninitialised value(s)'
valgrind warnings.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-24 15:08:21 +02:00
Andreas Cadhalpun
8e77f8ab4a mov: fix two memleaks
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-05-24 15:08:21 +02:00
Zhang Rui
c886dd2f58 avformat/mov: check result of avio_seek
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 18:48:18 +02:00
Carl Eugen Hoyos
caa41d1e4c lavf/mov: Tell users about the use_absolute_path option.
Fixes ticket #4539.
2015-05-17 02:08:58 +02:00
Michael Niedermayer
50393bce31 avformat/mov: Fix parsing short loci
Fixes Ticket4557

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-16 14:07:15 +02:00
Michael Niedermayer
9e4f0cfc8f avformat/mov: Print reason of loci parsing failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-16 14:06:25 +02:00
Michael Niedermayer
77ccc9145a avformat/mov: Use open_cb() if set
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-11 21:56:53 +02:00
Michael Niedermayer
2b97cc2e5b avformat/mov: Pass MovContext into mov_open_dref()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-11 18:12:24 +02:00
Michael Niedermayer
2025e803cd avformat/mov: Do not read ACLR into extradata for H.264
Fixes regression decoding AVCI
Fixes Ticket4493

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-30 00:02:47 +02:00
Chris Watkins
0703c44692 avformat/mov.c: Use %d to print an enum, not PRIu8
Using the PRIu8 format specifier to print an enum value causes a
compiler warning, so use %d instead.

Fixes ticket #4467.

Signed-off-by: Chris Watkins <watk@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-21 23:48:07 +02:00
Michael Niedermayer
e48a0a6c3f avformat/mov: remove per packet timestamp print trace, theres generic code doing this in utils.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 17:25:04 +02:00
Michael Niedermayer
4d50d53a6d Merge commit '9286de045968ad456d4e752651eec22de5e89060'
* commit '9286de045968ad456d4e752651eec22de5e89060':
  mov: Double-check that alias path is not an absolute path

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 11:03:32 +02:00
Michael Niedermayer
82d9c4e578 Merge commit '376589e5dd72aa2dd42500f456fca303fcdcad85'
* commit '376589e5dd72aa2dd42500f456fca303fcdcad85':
  mov: Read alternate absolute path in dref alis

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 05:51:40 +02:00
Michael Niedermayer
40d552dae6 Merge commit '1a3eb042c704dea190c644def5b32c9cee8832b8'
* commit '1a3eb042c704dea190c644def5b32c9cee8832b8':
  Replace av_dlog with normal av_log at trace level

Conflicts:
	ffplay.c
	libavdevice/fbdev_dec.c
	libavfilter/avfilter.c
	libavfilter/internal.h
	libavfilter/setpts.c
	libavfilter/src_movie.c
	libavfilter/vf_crop.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fieldorder.c
	libavformat/assdec.c
	libavformat/avidec.c
	libavformat/flvdec.c
	libavformat/http.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/mov.c
	libavformat/mpegenc.c
	libavformat/mpegts.c
	libavformat/mpegtsenc.c
	libavformat/mux.c
	libavformat/mxfdec.c
	libavformat/nsvdec.c
	libavformat/oggdec.c
	libavformat/r3d.c
	libavformat/rtspdec.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 03:19:47 +02:00
Vittorio Giovara
9286de0459 mov: Double-check that alias path is not an absolute path
nlvl_to and nlvl_from can be set to 1 if both alias and target files
are in the same directory, so actually check the first character of the
string. We can do this because MacOS filepaths (alis type 2) are always
converted to UNIX filepaths (alis type 18).
2015-04-19 22:50:24 +01:00
Vittorio Giovara
376589e5dd mov: Read alternate absolute path in dref alis
Absolute paths can be stored in alis type 2 and 18 according to my research:
the first is the canonical MacOS filepath, with path level separated by
colons, and the volume name within the filepath, while the second should be the
absolute filesystem path from the mount point.
2015-04-19 22:48:14 +01:00
Vittorio Giovara
1a3eb042c7 Replace av_dlog with normal av_log at trace level
This applies to every library where performance is not critical.
2015-04-19 12:41:59 +01:00
Michael Niedermayer
98c7d305a7 Merge commit 'be089af38f65dc8b1fe3564f98020fc815577edb'
* commit 'be089af38f65dc8b1fe3564f98020fc815577edb':
  mov: Rely on box type rather than file type for colr atom

Conflicts:
	libavformat/mov.c

See: 0276b95242
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-09 20:19:27 +02:00
Vittorio Giovara
be089af38f mov: Rely on box type rather than file type for colr atom
Although it's not allowed to use only allows 'nclc' in ISOM files, there
are samples that do not always respect this rule. This change prevents
atom overread and a spurious color range initialization.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-04-09 13:46:54 +02:00
Carl Eugen Hoyos
072198166e lavf/mov: Do not overread iTunes metadata.
Fixes ticket #4425.
2015-04-04 17:35:06 +02:00
Jochen Strunk
0276b95242 avformat/mov: check color parameter type explicitly.
Fixes ticket #4387.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Note, Vittorio Giovara had submitted a very similar fix to me privately
a few hours before this, iam applying Jochens because it comes with a
commit message too and i had not yet applied Vittorios, but For sake
of credit, Vittorio independently solved this first
2015-03-24 14:06:03 +01:00
Michael Niedermayer
dfea1acb21 Merge commit 'e4fe535d12f4f30df2dd672e30304af112a5a827'
* commit 'e4fe535d12f4f30df2dd672e30304af112a5a827':
  mov: Write the display matrix in order

Conflicts:
	libavformat/mov.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-24 01:14:31 +01:00
Vittorio Giovara
e4fe535d12 mov: Write the display matrix in order
This will allow to copy the matrix as is and it is just cleaner to keep
the matrix in the same order specified by the mov standard (which is
also explicitly described in the documentation).

In order to preserve compatibility, flip the angle sign in the display API
av_display_rotation_set() and av_display_rotation_get(), and improve the
documentation mentioning the rotation direction.
2015-03-23 20:53:28 +00:00
Derek Buitenhuis
414d6547f3 mov: Add option to keep exact packet sequence after seeking
The current behavior may produce a different sequence of packets
after seeking, compared to demuxing linearly from the beginning.
This is because the MOV demuxer seeks in each stream individually,
based on timestamp, which may set each stream at a slightly different
position than if the file would have been read sequentially.

This makes implementing certain operations, such as segmenting,
quite hard, and slower than need be.

Therefore, add an option which retains the same packet sequence
after seeking, as when a file is demuxed linearly.
2015-03-18 14:30:07 +00:00
Derek Buitenhuis
8692d74b73 mov: Add option to keep exact packet sequence after seeking
The current behavior may produce a different sequence of packets
after seeking, compared to demuxing linearly from the beginning.
This is because the MOV demuxer seeks in each stream individually,
based on timestamp, which may set each stream at a slightly different
position than if the file would have been read sequentially.

This makes implementing certain operations, such as segmenting,
quite hard, and slower than need be.

Therefore, add an option which retains the same packet sequence
after seeking, as when a file is demuxed linearly.
2015-03-18 14:28:56 +00:00
Michael Niedermayer
13f8bbfb70 avformat/mov: fix mis-detection of jpeg2000
Fixes demuxer choice for Ticket 2792

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-17 19:05:44 +01:00
Vittorio Giovara
423f5d50e4 mov: Fix little endian audio detection
Set this field to TRUE if the audio component is to operate on
little-endian data, and FALSE otherwise.

However TRUE and FALSE are not defined. Since this flag is just a boolean,
interpret all values except for 0 as little endian.

Sample-Id: 64bit_FLOAT_Little_Endian.mov
2015-03-17 13:34:23 +00:00
Michael Niedermayer
1e4d0498df avformat/mov: Disallow ".." in dref unless use_absolute_path is set
as this kind of allows to circumvent it to some extend.
We also could add a separate parameter or value to choose this

Found-by: ramiro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-16 03:47:56 +01:00
Michael Niedermayer
8003816e16 avformat/mov: Check for string truncation in mov_open_dref()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 21:57:04 +01:00
Michael Niedermayer
21a53dd08d avformat/mov: Use sizeof(filename) instead of a literal number
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-14 21:56:46 +01:00
Michael Niedermayer
cb39fe9336 Merge commit '91eee2af87278b3c2008f7a86d2cdfe6934e9f42'
* commit '91eee2af87278b3c2008f7a86d2cdfe6934e9f42':
  Revert "mov: Change DTS-based seek into CTS-based seek."

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-02 20:52:34 +01:00
Michael Niedermayer
82fe4072ea Revert "avformat/mov: Bypass av_add_index_entry()"
Next commit will revert the PTS seeking so this is not needed anymore

This reverts commit 38e641a060.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-02 20:46:17 +01:00
Martin Storsjö
91eee2af87 Revert "mov: Change DTS-based seek into CTS-based seek."
This reverts commit 4abfa387b8.

This commit broke playback of fragmented mp4 files with b-frames.
While investigating this, it turned out that the general framework
isn't ready for a PTS-based index yet. Revert this change until
a better thought out solution is in place.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-03-02 14:15:12 +02:00
Christophe Gisquet
60bdc868b9 lavf/mov: correct printf specifier
The type is int64_t.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-27 16:55:34 +01:00
Michael Niedermayer
bbbc8c6188 avformat/mov: Check ctts_count before use
Fixes out of array read
Fixes: asan_heap-oob_ae74b5_3610_cov_1739568095_test.3g2

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 13:31:34 +01:00
Michael Niedermayer
4d1b017c38 avformat/mov: Check av_add_index_entry() return value
Fixes NULL pointer dereference
Fixes: signal_sigsegv_b060e0_3794_cov_1293954059_vc1-wmapro.ism

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-23 22:48:35 +01:00
Kevin Wheatley
fb3fb1d0d4 avformat/mov: Add simple ACLR atom reading to set the color range of the incomming track for codec's like DNxHD that utilise AVID's proprietary atom.
On input ACLR will be used to set colour range no matter which codec
it is associated with.
No change for when it will be output.

Rework mov_read_extradata function to allow detection of truncated
atom reads by callers.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-19 15:42:55 +01:00
Michael Niedermayer
38e641a060 avformat/mov: Bypass av_add_index_entry()
The new mov code uses a temporally non sorted index since 4abfa387b8
and can thus no longer be filled with av_add_index_entry() which expects the index to be sorted.
Reverting 4abfa387b8 and this commit would be
a alternative fix as would be various other options.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-16 01:30:47 +01:00
Michael Niedermayer
f9e76d66e9 Merge commit '4abfa387b8234736f6e0e541951e3d5eb60eb843'
* commit '4abfa387b8234736f6e0e541951e3d5eb60eb843':
  mov: Change DTS-based seek into CTS-based seek.

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-16 01:28:02 +01:00
Yusuke Nakamura
4abfa387b8 mov: Change DTS-based seek into CTS-based seek.
CTS-based seek is reasonable since player requests frames in output order
not coded order.

This change fixes seek to a keyframe within consecutive keyframes.
Let's say P[0|-1] and P[1|0], here x and y inside [x|y] are PTS and DTS
respectively, and both two frames are a keyframe. If you try to seek on
PTS=0, i.e. P[0|-1], you'll get P[1|0] if the demuxer is DTS based. This
is obviously undesirable.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-02-15 21:26:04 +02:00
Diego Biurrun
36cf8eb448 mov: Fix compilation with DEBUG enabled 2015-02-14 10:45:16 -08:00
Michael Niedermayer
ad1549aec3 avformat/mov: print a warning if parsing udta failed
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-14 13:02:24 +01:00
Michael Niedermayer
849ad5175b avformat/mov: Heuristically detect raw udta
Fixes tkhd+moov fragment provided by koda

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-13 04:30:29 +01:00
Michael Niedermayer
5763f67502 avformat/mov: Check dimensions before setting aspect
Fixes division by 0
Fixes: asan_heap-uaf_143f420_728_cov_1441472032_HDV_0113.MP4

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-09 14:52:15 +01:00
Michael Niedermayer
a83e0639c0 Merge commit 'e3528d2a7bf29ba148d7ac1678552ce0089cd14f'
* commit 'e3528d2a7bf29ba148d7ac1678552ce0089cd14f':
  mov: Implement parsing of the "HandlerName" from the MP4 HDLR atom

Conflicts:
	libavformat/mov.c

See: b76bc01034
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-03 22:19:46 +01:00
Hendrik Leppkes
e3528d2a7b mov: Implement parsing of the "HandlerName" from the MP4 HDLR atom
This atom typically is used for a track title. The handler name is stored
as a Pascal string in the QT specs (first byte is the length of the string),
so do not export it.

A second length check based on the first character is added to avoid
overwriting an already specified handler_name (it happens with YouTube
videos for instance, the handler_name get masked), or specifying an
empty string metadata.

The Pascal string fix and the second length check are written
by Clément Bœsch <clement.boesch@smartjog.com>.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-02-03 15:15:12 +00:00
Michael Niedermayer
ed91c8651a avformat/mov: simplify pasp value before setting SAR
This avoids a 65536:65536 SAR

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-03 14:11:20 +01:00
Paul B Mahol
cc1357a173 avformat/mov: remove unneeded #include, there are no assert()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-01-31 08:57:07 +00:00
Michael Niedermayer
6d34665c76 Merge commit '32125781487411ed3b1b28b32063d6cd4024d4fc'
* commit '32125781487411ed3b1b28b32063d6cd4024d4fc':
  mov: export audio service type as side data

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-27 18:32:23 +01:00
Anton Khirnov
3212578148 mov: export audio service type as side data 2015-01-27 09:21:28 +01:00
Vittorio Giovara
4c5fa628da mov: Do not compute negative SAR values
This partially reverts cf70ba37ba, since
it didn't take into account when rotation is 0, but there is another
valid operation (eg. translation) in the matrix.

Found-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-23 14:54:59 +00:00
Jon Morley
47372caac5 libavformat/mov.c: Handle timecode from tmcd atom in counter mode
When the timecode value is in counter mode then it is important to use
the timescale and frameduration to calculate the timecode fps.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-23 13:14:15 +01:00
Michael Niedermayer
e32b07aea4 avformat/mov: Stricter sanity checks on the display_matrix
Fixes "broken" tkhd
Found-by: koda
Tested-by: koda
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-22 19:52:52 +01:00
Michael Niedermayer
cc18ea8de0 avformat/mov: Do not set aspect ratios that would contain zeros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-15 04:26:16 +01:00
Michael Niedermayer
47795505ac avformat/mov: rewrite aspect from matrix code
The original code was intended purely for rotation == 0
In cf70ba37ba the condition was
changed to use it only for rotation != 0
which broke the cases for which it was intended to be used
as well as breaking cases for which it was not intended to be
used.
This changes the code so it could work for the more general
case and fixes the regressions
If you have sample files that are not handled correctly
please open tickets or mail me!

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-15 04:22:00 +01:00
Michael Niedermayer
89b6382bec Merge commit 'cf70ba37ba74089a18295b29e77dead0a3222c9e'
* commit 'cf70ba37ba74089a18295b29e77dead0a3222c9e':
  mov: Check angle rather than full matrix when updating SAR

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-15 04:00:51 +01:00
Vittorio Giovara
cf70ba37ba mov: Check angle rather than full matrix when updating SAR
When the display matrix is not the identity one, but the rotation angle
is zero, there is no need to update the sample aspect ratio.

Otherwise, it is possible to obtain negative values which interferes
with transcoding in later stages. This kind of behaviour is reproducible
on mov files with "major_brand: MSNV".

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-01-14 17:17:23 +01:00
Carl Eugen Hoyos
a5334d4081 Handle r10k endianess atom DpxE.
Fixes playback and remuxing of r10k_full-range_big-endian.mov.

Reported, analyzed and tested by Olaf Matthes, olaf matthes gmx de
2015-01-11 12:15:03 +01:00
Michael Niedermayer
07e4ed5637 avformat/mov: Use avio_closep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-08 20:19:20 +01:00
Michael Niedermayer
383c6a3a07 avformat/mov: use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 15:07:50 +01:00
Michael Niedermayer
62eafb6a0d avformat/mov: Clear array to prevent potential out of array read from av_dlog()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 15:07:50 +01:00
Dale Curtis
3ebd76a9c5 mov: Fix negative size calculation in mov_read_default().
The previous code assumed if an atom was marked with a 64-bit
size extension, it actually had that data available. The new
code verfies there's enough data in the atom for this to be
done.

Failure to verify causes total_size > atom.size which will
result in negative size calculations later on.

Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 05:23:45 +01:00
Michael Niedermayer
3859868c75 avformat/mov: fix integer overflow in mov_read_udta_string()
Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 04:44:16 +01:00
Dale Curtis
db42d93a61 mov: Fix overflow and error handling in read_tfra().
Under abnormal conditions the item_count may exceed the max
allocation size on 32-bit systems, this causes the allocated
size to overflow and become too small for the given count.

Additionally, if av_reallocp() fails its allocation, the
fragment_index_count is not correctly decremented.

Ensuring further havoc may be wrought, the error code for
read_tfra() is not checked upon return.

Found-by: Paul Mehta <paul@paulmehta.com>

positive return code and use of _array functions by commiter

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 04:44:16 +01:00
Clément Bœsch
11201bbf7f avformat/mov: reindent after previous commit 2015-01-02 11:38:28 +01:00
Clément Bœsch
55faf56c72 avformat/mov: move edit list heuristics into mov_build_index()
mov_read_elst() is now only responsible from storing the table in a data
structure; this is consistent with other table readers functions.
2015-01-02 11:38:21 +01:00
Michael Niedermayer
24af050c2f Merge commit '64f7575fbd64e5b65d5c644347408588c776f1fe'
* commit '64f7575fbd64e5b65d5c644347408588c776f1fe':
  mov: avoid a memleak when multiple stss boxes are present

Conflicts:
	libavformat/mov.c

See: 5ab882d728
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-19 12:31:52 +01:00
Anton Khirnov
64f7575fbd mov: avoid a memleak when multiple stss boxes are present
CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-12-19 08:01:46 +01:00
Thomas Volkert
00d7555f34 wavdec: RIFX file format support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-18 00:10:35 +01:00
Michael Niedermayer
be9ce6e10a avformat/mov: fix integer overflow of size
Fixes: case1_call_stack_overflow.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-16 23:37:25 +01:00
Michael Niedermayer
caa7a3914f avformat/mov: check atom nesting depth
Fixes call stack overflow
Fixes: case1_call_stack_overflow.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-16 23:37:24 +01:00
Michael Niedermayer
1a86e29ff0 Merge commit '6f4364aba9d70dc5fd9f1c88b9c03bf9ea893d40'
* commit '6f4364aba9d70dc5fd9f1c88b9c03bf9ea893d40':
  mov: Fix handling of zero-length metadata values

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-16 02:23:43 +01:00
Martin Storsjö
6f4364aba9 mov: Fix handling of zero-length metadata values
Since 3cec81f4d4, a zero-length metadata value would try to
allocate 2*0 bytes, where av_malloc() returns NULL.

Always add one to the allocated length, to allow space for
a null terminator in the zero-length case.

Incidentally, this fixes fate-alac on RVCT 4.0, where a compiler
bug seems to mess up the mov muxer to the point that it writes
the wrong sort of metadata. Previously this bug was undetected,
but since 3cec81f4d4 such mov files started returning
AVERROR(ENOMEM) in the mov demuxer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-15 23:42:10 +02:00
Michael Niedermayer
d7de48f0df avformat/mov: Simplify code by using OFFSET() and FLAGS macros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-13 15:06:19 +01:00
Michael Niedermayer
e2829a8175 avformat/mov: Disable XMP metadata by default
This was suggested by cbsrobot, ubitux and koda

There are files with huge amounts of XMP data, which would otherwise
be displayed in the terminal output of FFmpeg

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-11 21:47:37 +01:00
Michael Niedermayer
99bf26fc6b Merge commit '3c01039e0bc7d269900e15551f8171c4328a0223'
* commit '3c01039e0bc7d269900e15551f8171c4328a0223':
  mov: further expand the list of parsed metadata tags

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-09 11:50:48 +01:00
Michael Niedermayer
885e74622e Merge commit 'e2e07dbaab1f17e995842b7eacec4665d44c3d14'
* commit 'e2e07dbaab1f17e995842b7eacec4665d44c3d14':
  mov: expand the list of parsed metadata tags

Conflicts:
	libavformat/mov.c

See: 543f3db978
See: dadf668df2
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 23:16:43 +01:00
Michael Niedermayer
0dcebe2620 Merge commit 'b704b648f9ecb830874627db958a37e004107d1b'
* commit 'b704b648f9ecb830874627db958a37e004107d1b':
  mov: parse XMP metadata on demand

Conflicts:
	libavformat/isom.h
	libavformat/version.h

See: 054c506e3d

The default is left unchanged at enabled
We can change the default if people prefer but i do not want to do that
in a merge.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 22:59:16 +01:00
Michael Niedermayer
420aebf0c5 Merge commit '174c5fde90060faab67796a5eaef742630f1db6e'
* commit '174c5fde90060faab67796a5eaef742630f1db6e':
  mov: parse @PRM and @PRQ metadata tags

Conflicts:
	libavformat/mov.c

See: f540851ce3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 22:14:29 +01:00
Michael Niedermayer
82f0f0482e Merge commit '35384934d6e27e0334060a23a0c83a3cb5cef198'
* commit '35384934d6e27e0334060a23a0c83a3cb5cef198':
  mov: cosmetics: reorder the list of tags

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 21:59:08 +01:00
Dave Rice
3c01039e0b mov: further expand the list of parsed metadata tags
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-08 14:28:16 +00:00
Vittorio Giovara
e2e07dbaab mov: expand the list of parsed metadata tags
Based on L-Smash code by Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>.
2014-12-08 14:28:09 +00:00
Vittorio Giovara
b704b648f9 mov: parse XMP metadata on demand
The Extensible Metadata Platform tag can contain various kind of data
which are not strictly related to the video file, such as history of edits
and saves from the project file. So display XMP metadata only when the
user explicitly requires it.

Based on a patch by Marek Fort <marek.fort@chyronhego.com>.
2014-12-08 13:53:30 +00:00
Vittorio Giovara
174c5fde90 mov: parse @PRM and @PRQ metadata tags
These tags describe the product and quicktime library version respectively.
They originate from Adobe Premiere, but also some other programs use them.
Contrary to other tags, they contain 'raw' data which is not to be
interpreted as iso639 or mac strings.

Based on a patch by Peter Ross <pross@xvid.org>.
2014-12-08 13:53:20 +00:00
Vittorio Giovara
35384934d6 mov: cosmetics: reorder the list of tags
Alphabetically order the list by the tag to facilitate the insertion of
new ones.
2014-12-08 13:53:10 +00:00
Matthieu Bouron
8c0a865ad9 mov: skip version and flags attributes in mov_read_chan()
Fixes decting channel layout for files with uncommon audio, such as
FL and FR in two separate streams. Introduced in 3bab7cd.

CC: libav-devel@libav.org
Sample-Id: ticket1474.mov
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-05 13:03:49 +00:00
Michael Niedermayer
02444f02f1 Merge commit '3cec81f4d4f26b62bc2d22bb450bbf51ec3a7f09'
* commit '3cec81f4d4f26b62bc2d22bb450bbf51ec3a7f09':
  mov: allocate the tag value dynamically

Conflicts:
	libavformat/mov.c

See: f31445a82d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 22:26:40 +01:00
Michael Niedermayer
781a5a392c Merge commit 'e352b293712ff7cbde67eba3ce3f8510b037de09'
* commit 'e352b293712ff7cbde67eba3ce3f8510b037de09':
  mov: Add an option for exporting all metadata

Conflicts:
	libavformat/isom.h
	libavformat/mov.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 22:13:20 +01:00
Michael Niedermayer
d0b0fe6691 Merge commit '5639ed9abb58311f82cf3499b682d228290adb09'
* commit '5639ed9abb58311f82cf3499b682d228290adb09':
  mov: do not truncate the language-prefixed tag

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 21:45:44 +01:00
Thilo Borgmann
3cec81f4d4 mov: allocate the tag value dynamically
This allows to load metadata entries longer than 1024 bytes.
Displaying them is still limited to 1024 characters, but applications
can load them fully now.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-02 15:28:22 +00:00
Vittorio Giovara
e352b29371 mov: Add an option for exporting all metadata 2014-12-02 15:28:22 +00:00
Vittorio Giovara
5639ed9abb mov: do not truncate the language-prefixed tag 2014-12-02 15:28:22 +00:00
Clément Bœsch
92fa1d9231 avformat/mov: change conjugation for "Duplicate" 2014-11-27 18:13:57 +01:00
Clément Bœsch
5ab882d728 avformat/mov: strengthen some table allocations 2014-11-27 18:12:40 +01:00
Michael Niedermayer
1b5d112406 avformat/mov: Fix memleaks for duplicate STCO/CO64/STSC atoms
Also see [FFmpeg-devel] [PATCH] avformat/mov: strengthen some table allocations
which contains more fixes but is unfinished

Fixes: signal_sigabrt_7ffff6ac7bb9_3484_cov_1830000177_starfox2.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-26 18:36:17 +01:00
Michael Niedermayer
4cd4a6de4f Merge commit '2007082d2db25f9305b8a345798b840ea7784fdb'
* commit '2007082d2db25f9305b8a345798b840ea7784fdb':
  mov: check ff_get_wav_header() return value

Conflicts:
	libavformat/mov.c

See: 6d55a40b00
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-18 03:34:05 +01:00
Vittorio Giovara
2007082d2d mov: check ff_get_wav_header() return value
CC: libav-stable@libav.org
Bug-Id: CID 717497
2014-11-18 00:40:06 +01:00
Mika Raento
b08fd7ea78 mov.c: fix handling of seek return in read_mfra
this would cause mfra to be ignored in files larger than 2G

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-15 12:04:34 +01:00
Michael Niedermayer
4a39d4c65a Merge commit '82ee7d0dda0fec8cdb670f4e844bf5c2927ad9de'
* commit '82ee7d0dda0fec8cdb670f4e844bf5c2927ad9de':
  Use gmtime_r instead of gmtime and localtime_r instead of localtime

Conflicts:
	libavformat/mov.c
	libavformat/mxfenc.c
	libavformat/wtvdec.c
	libavutil/parseutils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-26 02:38:26 +01:00
Michael Niedermayer
3b709fd912 Merge commit '9dcf2397219ca796f0fafce2a703770d6fd09920'
* commit '9dcf2397219ca796f0fafce2a703770d6fd09920':
  lavf: Check the return value of strftime

Conflicts:
	libavformat/wtvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-26 02:06:40 +01:00
Martin Storsjö
82ee7d0dda Use gmtime_r instead of gmtime and localtime_r instead of localtime
gmtime isn't thread safe in general. In msvcrt (which lacks gmtime_r),
the buffer used by gmtime is thread specific though.

One call to localtime is left in avconv_opt.c, where thread safety
shouldn't matter (instead of making avconv depend on the libavutil
internal header).

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-26 00:14:54 +03:00
Martin Storsjö
9dcf239721 lavf: Check the return value of strftime
If the buffer provided to strftime is too small, the buffer contents
are indeterminate - it does not guarantee actually null terminating
the buffer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-26 00:14:54 +03:00
Michael Niedermayer
eeb9242b62 Merge commit '50dbe6b3544fa64d5611e16553bf542fd71276b8'
* commit '50dbe6b3544fa64d5611e16553bf542fd71276b8':
  mov: fix assigment check

Conflicts:
	libavformat/mov.c

See: af2e5061bb
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-25 04:57:48 +02:00
Vittorio Giovara
50dbe6b354 mov: fix assigment check
CC: libav-stable@libav.org
Bug-Id: CID 1197050
2014-10-24 23:48:57 +01:00
Mika Raento
17702f1fc5 mov.c: reasonable bitrate for fragmented mp4
If using MFRA for timestamps, the stream may start from a large offset
and/or have gaps. With this change we calculate the bitrate based on
frames we've seen.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-21 18:06:18 +02:00
Thilo Borgmann
6e6b79e7b8 lavf/mov.c: Prevent memory leak in case of invalid metadata reads.
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-21 12:36:52 +02:00
Thilo Borgmann
f31445a82d lavf/mov.c: Allocate buffer in case of long metadata entries.
Fixes ticket #4018

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-20 19:27:34 +02:00
Michael Niedermayer
16f9f7b881 Merge commit '74b02377980321934e33969c84733ace7e9f4eeb'
* commit '74b02377980321934e33969c84733ace7e9f4eeb':
  mov: Correctly check the color transfer characteristics range

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-15 21:40:13 +02:00
Michael Niedermayer
1b54e6b12b avformat/mov: auodetect "use_mfra_for"
Reviewed-by: Mika Raento <mikie@iki.fi>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-15 20:17:23 +02:00
Vittorio Giovara
74b0237798 mov: Correctly check the color transfer characteristics range
Reported-by: Ruoyu <liangry@ucweb.com>
2014-10-15 14:48:40 +01:00
Michael Niedermayer
5552594a44 Merge commit 'a74f8121d88e0bdf0d69c22e4b3713032da9300a'
* commit 'a74f8121d88e0bdf0d69c22e4b3713032da9300a':
  mov: Handle tfdt atoms

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-14 22:24:12 +02:00
Martin Storsjö
a74f8121d8 mov: Handle tfdt atoms
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-14 13:52:32 +03:00
Michael Niedermayer
57884172e0 avformat/mov: fix mix of declaration and statement
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-13 16:12:30 +02:00
Mika Raento
a59808dd57 mov.c: allow reading fragment start dts/pts from fragmented mp4
This introduces a new option to the mov demuxer: -use_mfra_for
(pts|dts). When it's given and moofs and a MFRA are present, the MFRA's
TFRAs are read for fragment start times.

Unfortunately some programs that produce fragmented mp4s use the TFRA
time field for dts and some for pts. There is no realistic way to detect
which is the case, hence the responsibility is punted onto the user.
This also means that no behavioural change is enabled by default - you
must pass either dts or pts for anything to happen.

Without this change, timestamps for some discontinuous fragmented mp4 are
wrong, and cause audio/video desync and are not usable for generating
HLS.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-13 12:20:55 +02:00
Benoit Fouet
7cda31cb92 avformat/mov: E-AC-3 streams need parsing too.
syncframes in E-AC-3 can be combined to provide 6 audio blocks per
sample, thus requiring parsing for proper decoding.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-09 15:38:09 +02:00
Michael Niedermayer
5d36e8527f avformat/mov: Fix 'warning: format specifies type unsigned short but the argument has type int'
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-09 05:49:25 +02:00
Michael Niedermayer
349a32c436 Merge commit '0d8a3656ba4c0ae8e4e0c91ff6b07d72a317f9f6'
* commit '0d8a3656ba4c0ae8e4e0c91ff6b07d72a317f9f6':
  mov: support the Color Parameter Atoms 'colr'

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-09 02:27:53 +02:00
Vittorio Giovara
0d8a3656ba mov: support the Color Parameter Atoms 'colr' 2014-10-08 18:17:50 +01:00
Michael Niedermayer
02f7665a3c avformat/mov: do not overwrite extradata in mov_read_glbl()
Fixes regression from Ticket3962

This basically favors the first global header while since 34751f8313
it was the last. If this heuristic turns out worse, do not hesitate to revert this and
reopen 3962 as a feature request for multiple STSD

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-06 00:17:33 +02:00
Carl Eugen Hoyos
81cee700f7 Support decoding 32bit pcm audio in mov.
Such files are written by Convergent Design's Odyssey 7Q recorder.
2014-10-02 10:04:43 +02:00
Carl Eugen Hoyos
0744daa887 Do not print a useless error number if mov header reading fails.
The error string is printed by ffmpeg as for other demuxers.
2014-08-24 02:45:58 +02:00
Michael Niedermayer
a9f3bb14ba avformat/mov: use 64bit for size in mov_skip_multiple_stsd()
Fixes integer overflow
Fixes Ticket 3866

Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-21 17:49:37 +02:00
Michael Niedermayer
b07dc81a9e Merge commit '86dfcfd0e30d6645eea2c63c1c60a0550e7c97ea'
* commit '86dfcfd0e30d6645eea2c63c1c60a0550e7c97ea':
  mov: Drop unused parameter from ff_mov_read_esds()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-19 18:27:51 +02:00
Diego Biurrun
86dfcfd0e3 mov: Drop unused parameter from ff_mov_read_esds()
This is cleaner and avoids an uninitialized variable warning with MSVC.
2014-08-19 06:22:07 -07:00
Reimar Döffinger
a0941c8a2b Use new av_dict_set_int helper function.
Get rid of the many, slightly differing, implementations
of basically the same thing.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-08-16 14:31:41 +02:00
Michael Niedermayer
81a663f49e Drop remaining unneeded != NULL
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-15 22:47:45 +02:00
Michael Niedermayer
a90364d001 Merge commit 'cc3e88a2b9e7ecf62e4ea1c41ce1623cea67ee96'
* commit 'cc3e88a2b9e7ecf62e4ea1c41ce1623cea67ee96':
  mov: update AVFormatContext.event_flags with METADATA_UPDATED whenever metadata changes.

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-13 23:51:03 +02:00
Andrew Stone
cc3e88a2b9 mov: update AVFormatContext.event_flags with METADATA_UPDATED whenever metadata changes.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:24:09 +00:00
Marek Fort
d1e750cd51 avformat/mov: Support reading Avid's metadata for DNXHD codec.
The AALP atom is necessary to properly decode the alpha channel.
Needed for ticket #3707

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 18:39:04 +02:00
James Almer
d34ec64a22 replace calls to url_feof() with avio_feof()
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-08 00:48:38 +02:00
Mark Reid
f1e626a357 avformat/mov: read reel_name metadata from tmcd atom
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 23:37:55 +02:00
Marek Fort
054c506e3d avformat/mov: XMP metadata suppor.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 20:11:09 +02:00
Reimar Döffinger
1c84aad718 movdec: remove nonsensical snprintf.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-07-30 20:25:29 +02:00
Dale Curtis
70f7006eb3 avformat/mov: Pass through iTunSMPB from MOV.
Allows demuxing of iTunes files into adts while preserving gapless
metadata.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-22 02:11:48 +02:00
Michael Niedermayer
73b1283012 Merge commit 'edb1af7c466ebb28bfdb0c076e498e527b43d24f'
* commit 'edb1af7c466ebb28bfdb0c076e498e527b43d24f':
  mov: free the dv demux context with avformat_free_context()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-09 23:19:06 +02:00
Anton Khirnov
edb1af7c46 mov: free the dv demux context with avformat_free_context() 2014-07-09 13:38:35 +00:00
Michael Niedermayer
fd3388d63d Merge commit '18fb38fb9ea7e2d5997c096fccfcd4cb43f70294'
* commit '18fb38fb9ea7e2d5997c096fccfcd4cb43f70294':
  mov: Remove a variable that is set but never used

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-08 21:53:09 +02:00
Martin Storsjö
18fb38fb9e mov: Remove a variable that is set but never used
This silences a warning with gcc.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-07-08 21:14:43 +03:00
Carl Eugen Hoyos
d919fdd4f7 Do not detect jp2 images as mov files. 2014-07-05 02:11:17 +02:00
Michael Niedermayer
fb318def5d Merge commit '20f95f21f9b9595608ba668a6eca78f2d508be67'
* commit '20f95f21f9b9595608ba668a6eca78f2d508be67':
  mov: Support default-base-is-moof.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 16:31:57 +02:00
Yusuke Nakamura
20f95f21f9 mov: Support default-base-is-moof.
default-base-is-moof shall be set to track fragments compatible with DASH
Media Segments. So, this is a fundamental support for ISOBMFF ver. DASH.
This is meaningful only when base-data-offset-present is absent and two or
more track fragments are present in a movie fragment.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-07-01 14:36:06 +03:00
Michael Niedermayer
27b893b231 avformat/mov: fix "warning: variable altitude set but not used" warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-06 15:46:03 +02:00
Michael Niedermayer
a083543da0 Merge commit 'e7d6d0bf3c5cc1bc048b0ddbc169a91862568e0c'
* commit 'e7d6d0bf3c5cc1bc048b0ddbc169a91862568e0c':
  mov: Export geotag metadata fields

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-06 13:24:30 +02:00
Martin Storsjö
e7d6d0bf3c mov: Export geotag metadata fields
The '?xyz' form is used by android devices (and according to apple
mailing list archives, also by older iOS devices). The 'loci' field
(defined in 3GPP 26.244) is used by recent iOS devices.

Even though the loci field can contain an altitude, it was plain
0 in my sample. Just export longitude and latitude, in a string
format matching the one used by the '?xyz' metadata field.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-06-06 10:46:10 +03:00
Carl Eugen Hoyos
26b0d7198e Read mov files where the moov atom is hidden within a free atom.
Fixes ticket #1551 / issue 2226.
2014-05-31 16:57:27 +02:00
Michael Niedermayer
96470ca22b avformat/mov: allow seeking back to the begin even if nothing is marked as keyframe
Fixes Ticket 3663

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-26 01:23:46 +02:00
Clément Bœsch
e63a17bfdc avformat/mov: use av_display_rotation_get() for rotate metadata. 2014-05-23 23:30:21 +02:00
Michael Niedermayer
64bf845544 avformat/mov: Dont blindly trust the stream duration in seting chapter times
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-23 04:39:55 +02:00
Michael Niedermayer
07941c2cb2 Merge commit '853cc025d63ee2539fc0460dab62c5b9a3fd2043'
* commit '853cc025d63ee2539fc0460dab62c5b9a3fd2043':
  mov: store display matrix in a stream side data

Conflicts:
	libavformat/isom.h
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-19 19:21:53 +02:00
Vittorio Giovara
853cc025d6 mov: store display matrix in a stream side data
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-05-19 13:13:16 +02:00
Alex Sukhanov
8b96f31817 libavformat/mov: Elimitate double reading of COVR metadata if MOV_EXPORT_ALL_METADATA is enabled
Problem: ffmpeg tries to read COVR atom data twice if MOV_EXPORT_ALL_METADATA is enabled.
If COVR atom is the last in the stream, a parsing of such file fails.

Solution: just return immediatelly after mov_read_covr

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-15 03:43:37 +02:00
Michael Niedermayer
7426acff1a Merge commit '18f2514c4037befd37b02e4d4f10c159edf3b26f'
* commit '18f2514c4037befd37b02e4d4f10c159edf3b26f':
  mov: export stsd Compressorname in metadata

Conflicts:
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-01 17:13:05 +02:00
Anton Khirnov
18f2514c40 mov: export stsd Compressorname in metadata
Stop using the undocumented to-be-deprecated AVCodecContext.codec_name
field.
2014-05-01 09:25:46 +02:00
Michael Niedermayer
4d4bc89409 avformat/mov: merge mov_read_custom_metadata() and mov_read_custom()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 21:25:51 +02:00
Michael Niedermayer
6e573b7759 Merge commit '9a07fac678a8540d076e635061bbaa4ed09a9431'
* commit '9a07fac678a8540d076e635061bbaa4ed09a9431':
  mov: read hydrogenaudio replaygain information

Conflicts:
	libavformat/Makefile
	libavformat/mov.c

See: 37a15f3e66
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 21:25:15 +02:00
Anton Khirnov
9a07fac678 mov: read hydrogenaudio replaygain information 2014-04-10 13:53:32 +02:00
Schenk, Michael
b0a8521383 avformat/mov: reset drefs_count in close
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-07 14:51:36 +02:00
Michael Niedermayer
af2e5061bb avformat/mov: Fix width/height typo
Fixes CID1197050
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-05 22:49:17 +02:00
Michael Niedermayer
61b3b3315c Merge commit 'f1c4a54f6ecbf77a29aaaee09ca70c5468d0c509'
* commit 'f1c4a54f6ecbf77a29aaaee09ca70c5468d0c509':
  lavf: add supported extension to avi and mov demuxers

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-02 03:15:19 +02:00
Michael Niedermayer
45ba9d8545 Merge commit 'cba4e6062a02d5bf684e13a770be88aa1fec717e'
* commit 'cba4e6062a02d5bf684e13a770be88aa1fec717e':
  More correct printf format specifiers

Conflicts:
	libavcodec/h264_ps.c
	libavcodec/h264_refs.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-02 02:54:09 +02:00
Marc-Antoine Arnaud
f1c4a54f6e lavf: add supported extension to avi and mov demuxers 2014-04-02 00:27:53 +02:00
Diego Biurrun
cba4e6062a More correct printf format specifiers
This avoids compiler warnings about argument and specifier type mismatch.
2014-04-02 00:27:22 +02:00
Michael Niedermayer
1ffbaa88c9 Merge commit 'fce28c3c6d603b7f42a5dbe36bf240d0470469c8'
* commit 'fce28c3c6d603b7f42a5dbe36bf240d0470469c8':
  mov: fill in subtitle dimensions after parsing tkhd

See: 8ba432bc56
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-31 01:58:14 +02:00
Michael Niedermayer
12789d9636 mov: call mov_rewrite_dvd_sub_extradata() after parsing dimensions from tkhd
This also moves mov_rewrite_dvd_sub_extradata() to mov.c.

Sample-Id: NeroRecodeSample.mp4
2014-03-31 01:08:23 +02:00
Michael Niedermayer
fce28c3c6d mov: fill in subtitle dimensions after parsing tkhd
Sample-Id: NeroRecodeSample.mp4
2014-03-31 01:08:18 +02:00
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