Commit Graph

846 Commits

Author SHA1 Message Date
Carl Eugen Hoyos
ab82b77822 Fix possible NULL-pointer dereference when decoding mov files.
Fixes CID743440, introduced in 850e5c0.
2012-11-18 08:52:50 +01:00
Xidorn Quan
8ee6db393c mov: add more udta meta data recognition
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-16 14:12:37 +01:00
Carl Eugen Hoyos
850e5c041d Read QuickTime version 1 audio fields in broken mov files.
Matrox XMIO capture boards write files with major brand "JUNK"
and compatible brand "qt  " that contain QuickTime version 1
audio fields.

Fixes ticket #1881.
2012-11-15 14:38:19 +01:00
Michael Niedermayer
87d073eacc mov: Dont try to calculate with unknown durations, fix division by 0
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-14 14:08:44 +01:00
Michael Niedermayer
4392e69ad4 mov: check stps correctly, avoid overreading 1 element.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-13 21:45:53 +01:00
Michael Niedermayer
03b078721c Merge commit '97bf7c03b1338a867da52c159a2afecbdedcfa88'
* commit '97bf7c03b1338a867da52c159a2afecbdedcfa88':
  doc: git-howto: Leave reviewers time to react before pushing patches
  Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
  lavu: rename audioconvert.* to channel_layout.* and deprecate audioconvert.h

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/git-howto.texi
	ffmpeg_filter.c
	libavcodec/flacdec.c
	libavcodec/imc.c
	libavcodec/mpegaudiodec.c
	libavcodec/utils.c
	libavfilter/asrc_anullsrc.c
	libavfilter/audio.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/avfiltergraph.c
	libavfilter/buffer.c
	libavutil/Makefile
	libavutil/audioconvert.h
	libavutil/channel_layout.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-12 11:32:11 +01:00
Justin Ruggles
a903f8f087 Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
Also reorder some other #include when applicable.
2012-11-11 13:35:12 -05:00
Michael Niedermayer
eb3dc23705 mov: Make sure no streams after the header lack a timescale.
Fixes division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-10 13:29:23 +01:00
Michael Niedermayer
58c2c17f1d mov_probe: use correct variable
Fixes CID739867
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-25 00:24:25 +02:00
Carl Eugen Hoyos
2fdc6f355c Do not detect mov with maximum score if the atom size is too small.
Fixes mpegts-in-mov, ticket #987 / issue 2223.
2012-10-23 22:41:15 +02:00
Carl Eugen Hoyos
fa190b3cd7 Improve MPEG-PS-in-MOV detection.
Fixes issue 1520.
2012-10-21 19:30:43 +02:00
Michael Niedermayer
217193facd bavformat/mov: add {} to complex ifs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-21 18:05:23 +02:00
Petter Ericson
7abf394814 mov.c: Check for stsd + m1s tag indicating MOV-wrapped MPEG-PS, and force continued probing if found.
Fixes Ticket241
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 16:07:49 +02:00
Michael Niedermayer
a4fe661157 mov_probe: fix integer overflows
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-17 17:50:14 +02:00
Michael Niedermayer
adbb75dbd8 mov: fix time types related to mov_metadata_creation_time
Fixes Ticket1817
Based on patch by: Przemyslaw Wesolek <przemyslaw.wesolek@go.art.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-17 02:48:30 +02:00
Michael Niedermayer
6d55a40b00 mov: print warning if ff_get_wav_header() fails
Fixes CID717497
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-16 20:21:31 +02:00
Michael Niedermayer
d067e25437 mov: fix integer avoption types
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-07 03:20:36 +02:00
Michael Niedermayer
f7f5370b4b mov: add option to ignore edit lists.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-02 14:18:46 +02:00
Michael Niedermayer
594b1fcb28 mov: add av_dlog() to dump edit lists.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-29 18:50:18 +02:00
Michael Niedermayer
3ceeb01c06 mov: only print multiple edit lists warning for actually unsupported cases
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-29 18:44:35 +02:00
Michael Niedermayer
c0209facd2 mov: remove default of 1024 sample skip for aac.
It is not correct in all cases and it is less predictable than a skip of 0
for user applications.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-28 20:30:37 +02:00
Michael Niedermayer
5864ce13d1 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mp3dec: read Xing frame TOC index
  mp3dec: use named constants for Xing header flags
  libx264: add support for nal-hrd, required for Blu-ray streams.
  mov: support random access point grouping
  matroskadec: properly support BlockDuration

Conflicts:
	libavcodec/libx264.c
	libavformat/isom.h
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 21:46:35 +02:00
Michael Niedermayer
168bc5f2c5 mov: fix 32/64 format type
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-19 23:36:35 +02:00
Yusuke Nakamura
d17d0ec8c2 mov: support random access point grouping
Frames described by this grouping are the starter of a closed or
an open GOP.
This is useful for open GOP of H.264 stream which is not described
by sync sample atom.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-19 20:34:15 +02:00
Michael Niedermayer
67d501b4f1 Merge commit '1b3439b3055b083df51d7f7838ecc6b3f708b15c'
* commit '1b3439b3055b083df51d7f7838ecc6b3f708b15c':
  mpegvideo: move frame size dependent memory management to separate functions
  configure: add --toolchain option
  configure: Make the smoothstreaming muxer enable the ismv muxer
  smoothstreaming: Export the mp4 codec tags
  mov: check for EOF in long lasting loops
  avcodec: cleanup utils.c
  binkaudio: remove unneeded GET_BITS_SAFE macro
  binkaudio: use float sample format
  binkaudio: use a different value for the coefficient scale for the DCT codec

Conflicts:
	configure
	libavcodec/mpegvideo.c
	libavcodec/utils.c
	libavformat/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-19 15:13:53 +02:00
Luca Barbato
9888ffb1ce mov: check for EOF in long lasting loops
A quite widespread pattern in the demuxer is read a 32bit unsigned
integer and then loop till this value is reached.

Checking for EOF prevents pathological situations.
2012-09-18 15:32:52 +02:00
Michael Niedermayer
291b220377 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avconv: flush filtered frames before reconfiguring filters
  mov: stsd entries must be at least 16 byte
  mov: detect EOF in mov_read_dref()
  file: return proper error on seek failures

Conflicts:
	libavformat/file.c
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-17 15:15:43 +02:00
Michael Niedermayer
a5ea623b36 mov: stsd entries must be at least 16 byte
Fix near infinite loop in stsd parsing.
Bug found by: Diana Elena Muscalu

The size is unsigned according the specification.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-16 16:53:06 +02:00
Michael Niedermayer
9db67bedf0 mov: detect EOF in mov_read_dref()
Avoid a near infinite loop.
Issue discovered by cosminamironesei.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-16 16:31:03 +02:00
Michael Niedermayer
fa85118510 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mov_chan: Pass a separate AVIOContext for reading
  af_asyncts: check return value from lavr when flushing.
  mss2: simplify loop in decode_rle()
  mss12: avoid unnecessary division in arith*_get_bit()
  mss2: do not try to read too many palette entries
  mpegvideo: set AVFrame fields to NULL after freeing the base memory
  configure: Set the right cc_e flags for msvc

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-07 13:50:24 +02:00
Samuel Pitoiset
9afb7061f9 mov_chan: Pass a separate AVIOContext for reading
This fixes crashes when called from rtpdec_qt, where
AVFormatContext->pb is null, a crash present since 3bab7cd128.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-07 10:49:35 +03:00
Piotr Bandurski
5081310b58 lavf: add missing new line to some error messages 2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-01 17:35:21 +02:00
Michael Niedermayer
158a70f17a mov: fix av_log int type
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-30 00:22:58 +02:00
Justin Greer
e16fda9236 mov: Change default aac priming fallback from 2112 to 1024
This fixes priming for faac

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-21 22:32:31 +02:00
Justin Greer
37a15f3e66 mov: parse custom "----" Metadata
This fixes the priming samples for NERO AAC LC

Simplified-by: Michael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-21 22:31:26 +02:00
Michael Niedermayer
6093960ae3 movdec: Try to recover from overreading atoms
Fixes Ticket1596

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-15 03:21:19 +02:00
Piotr Bandurski
bd92205014 mov: remux AALP tag
AALP(AALP001) tag is present in 32bpp files encoded with avid codecs

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-12 18:46:29 +02:00
Michael Niedermayer
2e4b662787 mov: add av_dlog() to CTTS reading code like is already done in STTS.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-11 23:27:27 +02:00
Michael Niedermayer
bb2f13c19f rename missed CodecID to AVCodecID
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 23:57:21 +02:00
Michael Niedermayer
7a72695c05 Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85':
  Replace all CODEC_ID_* with AV_CODEC_ID_*
  lavc: add AV prefix to codec ids.

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	ffprobe.c
	ffserver.c
	libavcodec/8svx.c
	libavcodec/avcodec.h
	libavcodec/dnxhd_parser.c
	libavcodec/dvdsubdec.c
	libavcodec/error_resilience.c
	libavcodec/h263dec.c
	libavcodec/libvorbisenc.c
	libavcodec/mjpeg_parser.c
	libavcodec/mjpegenc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pcm.c
	libavcodec/r210dec.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/version.h
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavformat/asfdec.c
	libavformat/asfenc.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/caf.c
	libavformat/electronicarts.c
	libavformat/flacdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/framecrcenc.c
	libavformat/img2.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/matroska.c
	libavformat/matroskadec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/movenc.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegts.c
	libavformat/mxf.c
	libavformat/mxfdec.c
	libavformat/mxfenc.c
	libavformat/nsvdec.c
	libavformat/nut.c
	libavformat/oggenc.c
	libavformat/pmpdec.c
	libavformat/rawdec.c
	libavformat/rawenc.c
	libavformat/riff.c
	libavformat/sdp.c
	libavformat/utils.c
	libavformat/vocenc.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 22:45:46 +02:00
Anton Khirnov
36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Michael Niedermayer
e4b53d995c mov: dont clip timestamps at 0
Fixes Ticket1251

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-06 01:38:18 +02:00
Piotr Bandurski
5d2f89a23c movenc: fix remuxing of svq3 2012-08-05 23:58:10 +02:00
Michael Niedermayer
d1dad7c824 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpc8: return more meaningful error codes.
  mpc: return more meaningful error codes.
  wv,mpc8: don't return apetag data in packets.
  rtmp: do not warn about receiving metadata packets
  x86: h264dsp: Adjust YASM #ifdefs
  x86: yadif: Mark mmxext optimizations as such
  h264: convert loop filter strength dsp function to yasm.
  Improve descriptiveness of a number of codec and container long names

Conflicts:
	libavcodec/flvdec.c
	libavcodec/libopenjpegdec.c
	libavformat/apetag.c
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-31 22:41:00 +02:00
Diego Biurrun
0177b7d23a Improve descriptiveness of a number of codec and container long names 2012-07-30 20:46:55 +02:00
Michael Niedermayer
7d1918affe Merge remote-tracking branch 'qatar/master'
* qatar/master:
  flvdec: remove spurious use of stream id
  lavf: deprecate r_frame_rate.
  lavf: round estimated average fps to a "standard" fps.

Conflicts:
	ffmpeg.c
	ffprobe.c
	libavformat/avformat.h
	libavformat/electronicarts.c
	libavformat/flvdec.c
	libavformat/rawdec.c
	libavformat/utils.c
	tests/ref/fate/iv8-demux

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-30 00:56:33 +02:00
Anton Khirnov
aba232cfa9 lavf: deprecate r_frame_rate.
According to its description, it is supposed to be the LCM of all the
frame durations. The usability of such a thing is vanishingly small,
especially since we cannot determine it with any amount of reliability.
Therefore get rid of it after the next bump.

Replace it with the average framerate where it makes sense.

FATE results for the wtv and xmv demux tests change. In the wtv case
this is caused by the file being corrupted (or possibly badly cut) and
containing invalid timestamps. This results in lavf estimating the
framerate wrong and making up wrong frame durations.
In the xmv case the file contains pts jumps, so again the estimated
framerate is far from anything sane and lavf again makes up different
frame durations.

In some other tests lavf starts making up frame durations from different
frame.
2012-07-29 08:06:30 +02:00
Carl Eugen Hoyos
20e88d8618 Fix avui stream-copy.
The native decoder and MPlayer's binary decoder only need the
APRG atom, QuickTime at least requires also the ARES atom and
four additional 0 bytes padding at the end of stsd.
2012-07-25 09:26:17 +02:00
Michael Niedermayer
e4c00aca96 Merge remote-tracking branch 'qatar/master'
* qatar/master: (38 commits)
  alac: cosmetics: general pretty-printing and comment clean up
  alac: calculate buffer size outside the loop in allocate_buffers()
  alac: change some data types to plain int
  alac: cosmetics: rename some variables and function names
  alac: multi-channel decoding support
  alac: split element parsing into a separate function
  alac: support a read sample size of up to 32
  alac: output in planar sample format
  alac: add 32-bit decoding support
  alac: simplify channel interleaving
  alac: use AVPacket fields directly in alac_decode_frame()
  alac: fix check for valid max_samples_per_frame
  alac: use get_sbits() to read LPC coefficients instead of casting
  alac: move the current samples per frame to the ALACContext
  alac: avoid using a double-negative when checking if the frame is compressed
  alac: factor out output_size check in predictor_decompress_fir_adapt()
  alac: factor out loading of next decoded sample in LPC prediction
  alac: use index into buffer_out instead of incrementing the pointer
  alac: simplify lpc coefficient adaptation
  alac: reduce the number of local variables needed in lpc prediction
  ...

Conflicts:
	libavcodec/alac.c
	libavformat/cafdec.c
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-19 23:31:04 +02:00
Justin Ruggles
3bab7cd128 avformat: move 'chan' tag parsing to mov_chan.c to share with the CAF demuxer 2012-07-19 13:26:45 -04:00