1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-07-27 06:24:44 +02:00
Commit Graph

307 Commits

Author SHA1 Message Date
Diego Biurrun
daf8cf358a avformat: Don't anonymously typedef structs 2015-02-14 10:13:47 -08:00
Michael Niedermayer
65b83ce01b avformat/rmdec: Check the return value of av_get_packet()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-18 20:55:49 +01:00
wm4
aab74a38b8 rm: fix memory leak on init failure
AVInputFormat.read_close is not called if AVInputFormat.read_header
fails, so this needs to be handled separately.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-10 00:26:43 +01:00
Michael Niedermayer
03abf55f25 avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-06 00:49:23 +01:00
Michael Niedermayer
50f9de59a0 avformat/rmdec: rm_read_extradata: add error message for oversized extradata
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-06 00:49:20 +01:00
Michael Niedermayer
ef2f9073dd Merge commit '1c77ead1fb14d64e6798fc5e32af04abcb3cebb4'
* commit '1c77ead1fb14d64e6798fc5e32af04abcb3cebb4':
  rm: Use the correct codec_data_size signedness

Conflicts:
	libavformat/rm.h
	libavformat/rmdec.c

See: a6f730730b
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-06 00:48:47 +01:00
Luca Barbato
1c77ead1fb rm: Use the correct codec_data_size signedness
The function takes a size and not an offset.

CC: libav-stable@libav.org
Sample-Id: rm_deadlock.rm

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-12-04 13:14:28 +00:00
Michael Niedermayer
a6f730730b avformat/rmdec: Check codec_data_size
Fixes infinite loop
Fixes Ticket4154

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 20:01:18 +01:00
Carl Eugen Hoyos
5badcdf20d Rename sync() functions in libavformat.
Fixes compilation on Android where the sync() definition in
unistd.h interferes with the static definitions in libavformat.
2014-11-25 23:49:58 +01:00
Michael Niedermayer
979062fe2f Merge commit 'be42c0b8d57fe2ea769892d102ffd5561dc18709'
* commit 'be42c0b8d57fe2ea769892d102ffd5561dc18709':
  rmdec: stricter error check to avoid theoretical unitialized use

Conflicts:
	libavformat/rmdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-21 23:47:44 +02:00
Michael Niedermayer
840bc8e284 Merge commit '7207dd8f829baee58b4df6c97c19ffde77039e8d'
* commit '7207dd8f829baee58b4df6c97c19ffde77039e8d':
  rmdec: check av_new_packet return value

Conflicts:
	libavformat/rmdec.c

See: c01a462cda
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-21 23:01:26 +02:00
Vittorio Giovara
be42c0b8d5 rmdec: stricter error check to avoid theoretical unitialized use
CC: libav-stable@libav.org
Bug-Id: CID 90558
2014-10-21 14:37:48 +01:00
Vittorio Giovara
7207dd8f82 rmdec: check av_new_packet return value
CC: libav-stable@libav.org
Bug-Id: CID 733714
2014-10-21 14:37:48 +01:00
Michael Niedermayer
ea7ebadeb7 avformat/rmdec: very basic MLTI support
Fixes Ticket2152

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-11 14:13:03 +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
Diego Biurrun
73953df71a Replace av_malloc() and memset(0) by av_mallocz() 2014-06-22 18:43:11 +02:00
Michael Niedermayer
b917d7024e Merge commit 'ef9732162cd4b593c6db28fdd352ebef21b5c1ca'
* commit 'ef9732162cd4b593c6db28fdd352ebef21b5c1ca':
  rmdec: do not export anything to AVCodecContext.codec_name

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-01 17:49:57 +02:00
Anton Khirnov
ef9732162c rmdec: do not export anything to AVCodecContext.codec_name
That field will be deprecated and the value that is written there is not
particularly useful.
2014-05-01 09:26:51 +02: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
77d2a1ca59 avformat/rmdec: when reading audio blocks, dont leave holes when reading fails
The fate test is changed because the reference file depends on the use of
non cleared data at the very
end. Alternatively we could upload a new reference file, though that would
then have to be changed every time the handling of a truncated frame changes
or theres a change to error concealment, each time adding a new file ...

Fixes use of uninitialized memory
Fixed: msan_uninit-mem_7f3c02b81363_2787_RLG2_19.rm
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-09 23:50:59 +01:00
Michael Niedermayer
ed1eb9602c avformat/rmdec: check that sub_packet_size fit in the packet for DEINT_ID_GENR
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fa8c49400d0_3923_audiosig.rm
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-07 00:26:33 +01:00
Michael Niedermayer
165f96cd2d avformat/rmdec: move packet allocation down
Fixes memleak
Fixes: msan_uninit-mem_7fc5d73327d4_6192_kuerti.ra
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-26 04:16:10 +01:00
Michael Niedermayer
4e394a98f2 avformat/rmdec: check against mismatching int4 interleaver parameters which would leave uninitialized holes
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f9cf38857c0_4582_coop.ra
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-26 04:02:40 +01:00
Michael Niedermayer
fd335aa326 avformat/rmdec: use ff_get_extradata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-25 17:38:29 +01:00
Michael Niedermayer
b797a00f63 avformat/rmdec: zero string destination before use
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f9677850d99_4635_crashed.rm
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-21 23:27:09 +01:00
Michael Niedermayer
d04ec6ffc5 avformat/rmdec: english typos
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-25 19:14:36 +02:00
Michael Niedermayer
aaf02f6ede avformat/rmdec: add some error messages
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-24 17:05:57 +02:00
Michael Niedermayer
f7106e00f7 avformat/rmdec: fix return code of ff_rm_parse_packet()
Broken by aecb9d3
Fixes assertion failure
Fixes Ticket3042

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-24 16:53:50 +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
f54d751f33 Merge commit '0f310a6f333b016d336674d086045e8473fdf918'
* commit '0f310a6f333b016d336674d086045e8473fdf918':
  rmdec: Validate the fps value

Conflicts:
	libavformat/rmdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-19 10:38:40 +02:00
Martin Storsjö
0f310a6f33 rmdec: Validate the fps value
Abort if it is invalid if strict error checking has been requested.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-18 11:30:06 +03:00
Michael Niedermayer
4cfe3b7405 Merge commit '7df9e693a34c84c698da60426c78140c950f95ed'
* commit '7df9e693a34c84c698da60426c78140c950f95ed':
  cosmetics: Fix ATRAC codec name spelling

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-03 15:05:18 +02:00
Diego Biurrun
7df9e693a3 cosmetics: Fix ATRAC codec name spelling 2013-09-02 21:38:57 +02:00
Michael Niedermayer
20be5e0a0e Merge commit '7950e519bb094897f957b9a9531cc60ba46cbc91'
* commit '7950e519bb094897f957b9a9531cc60ba46cbc91':
  Disable deprecation warnings for cases where a replacement is available

Conflicts:
	libavcodec/avpacket.c
	libavcodec/pthread.c
	libavcodec/utils.c
	libavdevice/v4l2.c
	libavfilter/avfiltergraph.c
	libavfilter/buffersrc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-03 10:08:30 +02:00
Diego Biurrun
7950e519bb Disable deprecation warnings for cases where a replacement is available 2013-08-02 19:19:02 +02:00
Carl Eugen Hoyos
aecb9d39bc rmdec: Forward error messages from rm_assemble_video_frame() to the caller.
Fixes the cause of a null pointer dereference on oom
described in ticket #2724.
2013-07-13 17:16:30 +02:00
Piotr Bandurski
161047f010 rmdec: fix crash in case of oom
Fixes ticket #2724

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-12 04:24:35 +02:00
Michael Niedermayer
d35b6cd377 rmdec: Use the AVIOContext given as parameter in rm_read_metadata()
This fixes crashes when playing back certain RealRTSP streams.

When invoked from the RTP depacketizer, the full realmedia
demuxer isn't invoked, but only certain functions from it, where
a separate AVIOContext is passed in as parameter (for the buffer
containing the data to parse). The functions called from within
those entry points should only be using that parameter, not
s->pb. In the depacketizer case, s is the RTSP context, where ->pb
is null.

Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-07 13:30:12 +03:00
Michael Niedermayer
bf87908cd8 rmdec: Pass AVIOContext to rm_read_metadata()
Fix null pointer dereference
Fixes Ticket2588

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-02 00:45:15 +02:00
Michael Niedermayer
161dee4321 rmdec: dont return uninitialized data
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-17 02:16:58 +02:00
Michael Niedermayer
519ebb5ee5 rmdec: flush audio packet on seeking
Fixes Ticket1605

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-18 00:08:59 +01:00
Anton Khirnov
85a5bc054c lavf: remove disabled FF_API_R_FRAME_RATE cruft 2013-03-11 18:23:50 +01:00
Michael Niedermayer
2653e12520 Merge commit '1afddbe59e96af75f1c07605afc95615569f388f'
* commit '1afddbe59e96af75f1c07605afc95615569f388f':
  avpacket: use AVBuffer to allow refcounting the packets.

Conflicts:
	libavcodec/avpacket.c
	libavcodec/utils.c
	libavdevice/v4l2.c
	libavformat/avidec.c
	libavformat/flacdec.c
	libavformat/id3v2.c
	libavformat/matroskaenc.c
	libavformat/mux.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-08 19:12:03 +01:00
Anton Khirnov
1afddbe59e avpacket: use AVBuffer to allow refcounting the packets.
This will allow us to avoid copying the packets in many cases.

This breaks ABI.
2013-03-08 07:33:45 +01:00
Michael Niedermayer
0780fe2740 rmdec: Limit videobufsize to remaining amount of data
Fixes excessive memory allocation

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-07 21:35:52 +01:00
Jean First
7fc73d9ab7 rmdec: fix compiler warning for uninitialized variables
Signed-off-by: Jean First <jeanfirst@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-25 23:54:34 +01:00
Piotr Bandurski
76f126ba2e rmdec: set bit rate for ra3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-23 15:59:41 +01:00
Piotr Bandurski
2e6bd22bbf rmdec: set bit rate for ra4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-23 00:10:49 +01:00
Carl Eugen Hoyos
d687b8c875 Cosmetics: Reindent after last commit. 2012-12-18 23:06:00 +01:00
Carl Eugen Hoyos
00a62e6776 Do not skip three bytes and don't search for extradata in old realaudio files.
Fixes ticket #1557.
2012-12-18 23:04:19 +01:00
Michael Niedermayer
076300bf8b Merge commit 'bfe5454cd238b16e7977085f880205229103eccb'
* commit 'bfe5454cd238b16e7977085f880205229103eccb':
  lavf: move ff_codec_get_tag() and ff_codec_get_id() definitions to internal.h
  lavf: move "MP3 " fourcc from riff to nut
  fate: vpx: Add dependencies
  fate: Fix wavpack-matroskamode test dependencies
  x86: dsputilenc: port to cpuflags

Conflicts:
	libavformat/internal.h
	libavformat/nut.c
	tests/fate/vpx.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-29 13:45:57 +01:00
Justin Ruggles
bfe5454cd2 lavf: move ff_codec_get_tag() and ff_codec_get_id() definitions to internal.h 2012-11-28 11:18:49 -05:00
Michael Niedermayer
3616afced6 rmdec: fix av_log level and context
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-23 01:19:48 +01:00
Michael Niedermayer
799d749c77 Merge remote-tracking branch 'qatar/master'
* qatar/master: (24 commits)
  yop: set channel layout
  wtv: set channel layout for mpeg audio
  westwood_aud: set channel layout
  wc3movie: set channel layout
  tmv: set channel layout
  tiertexseq: set channel layout
  swfdec: set channel layout
  sol: set channel layout
  smacker: set channel layout
  siff: set channel layout
  sierravmd: set channel layout
  rtpdec_amr: set channel layout
  rsodec: set channel layout
  rmdec: set channel layout for RA version 3
  qcp: set channel layout
  psxstr: set channel layout
  omadec: set channel layout
  oggparsespeex: validate channel count and set channel layout
  nuv: set channel layout
  mxg: set channel layout
  ...

Conflicts:
	libavformat/swfdec.c
	libavformat/wtv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-13 11:09:38 +01:00
Justin Ruggles
60a585304c rmdec: set channel layout for RA version 3 2012-11-12 10:33:21 -05:00
Michael Niedermayer
c01a462cda rmdec: fix null derefercne
Fixes CID733714
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-26 16:18:09 +02:00
Michael Niedermayer
1bf5071104 rmdec: use av_assert for audio_pkt_cnt
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-26 16:13:16 +02:00
Michael Niedermayer
9270a2b374 Merge commit '4c995fafd861f537360b3717901cdbed6a6844e7'
* commit '4c995fafd861f537360b3717901cdbed6a6844e7':
  configure: simplify get_version() function
  build: support asan and tsan toolchain shortcuts
  rmdec: Move SIPR code shared with Matroska demuxer to a separate file

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-16 13:20:46 +02:00
Diego Biurrun
7e68c91e24 rmdec: Move SIPR code shared with Matroska demuxer to a separate file 2012-10-15 13:34:07 +02:00
Michael Niedermayer
31ab1575e5 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avcodec: Convert some commented-out printf/av_log instances to av_dlog
  avcodec: Drop silly and/or broken printf debug output
  avcodec: Drop some silly commented-out av_log() invocations
  avformat: Convert some commented-out printf/av_log instances to av_dlog
  avformat: Remove non-compiling and/or silly commented-out printf/av_log statements
  Remove some silly disabled code.
  ac3dec: ensure get_buffer() gets a buffer for the correct number of channels

Conflicts:
	libavcodec/dnxhddec.c
	libavcodec/ffv1.c
	libavcodec/h264.c
	libavcodec/h264_parser.c
	libavcodec/mjpegdec.c
	libavcodec/motion_est_template.c
	libavcodec/mpegaudiodec.c
	libavcodec/mpegvideo_enc.c
	libavcodec/put_bits.h
	libavcodec/ratecontrol.c
	libavcodec/wmaenc.c
	libavdevice/timefilter.c
	libavformat/asfdec.c
	libavformat/avidec.c
	libavformat/avienc.c
	libavformat/flvenc.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-01 16:12:38 +02:00
Diego Biurrun
72eaba5e4f avformat: Convert some commented-out printf/av_log instances to av_dlog 2012-10-01 10:24:28 +02:00
Michael Niedermayer
e6dc0da504 rmdec: remove unused variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-03 22:40:41 +02:00
Michael Niedermayer
62527dc245 rmdec: parse logical-fileinfo, instead of creating phantom tracks
Fixes Ticket1090

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-21 06:15:22 +02:00
Michael Niedermayer
19a61bf39d rmdec: pass mime type to ff_rm_read_mdpr_codecdata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-21 06:14:29 +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
b5da7d4c1a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avformat: Drop pointless "format" from container long names
  swscale: bury one more piece of inline asm under HAVE_INLINE_ASM.
  wv: K&R formatting cosmetics
  configure: Add missing descriptions to help output
  h264_ps: declare array of colorspace strings on its own line.
  fate: amix: specify f32 sample format for comparison
  tiny_psnr: support 32-bit float samples
  eamad/eatgq/eatqi: call special EA IDCT directly
  eamad: remove use of MpegEncContext
  mpegvideo: remove unnecessary inclusions of faandct.h
  af_asyncts: avoid overflow in out_size with large delta values
  af_asyncts: add first_pts option

Conflicts:
	configure
	libavcodec/eamad.c
	libavcodec/h264_ps.c
	libavformat/crcenc.c
	libavformat/ffmdec.c
	libavformat/ffmenc.c
	libavformat/framecrcenc.c
	libavformat/md5enc.c
	libavformat/nutdec.c
	libavformat/rawenc.c
	libavformat/yuv4mpeg.c
	tests/tiny_psnr.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-30 23:28:31 +02:00
Diego Biurrun
6774247a9d avformat: Drop pointless "format" from container long names 2012-07-30 13:59:06 +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
William Yu
6d4e0d1b7e avf:rmdec.c fill duration to AVFormatContext
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-17 16:47:20 +02:00
Michael Niedermayer
3194ab78a6 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avcodec: add a cook parser to get subpacket duration
  FATE: allow lavf tests to alter input parameters
  FATE: replace the acodec-pcm_s24daud test with an enc_dec_pcm checksum test
  FATE: replace the acodec-g726 test with 4 new encode/decode tests
  FATE: replace current g722 encoding tests with an encode/decode test
  FATE: add a pattern rule for generating asynth wav files
  FATE: optionally write a WAVE header in audiogen
  avutil: add audio fifo buffer

Conflicts:
	doc/APIchanges
	libavcodec/version.h
	libavutil/avutil.h
	tests/Makefile
	tests/codec-regression.sh
	tests/fate/voice.mak
	tests/lavf-regression.sh
	tests/ref/acodec/g722
	tests/ref/acodec/g726
	tests/ref/acodec/pcm_s24daud
	tests/ref/lavf/dv_fmt
	tests/ref/lavf/gxf
	tests/ref/lavf/mxf
	tests/ref/lavf/mxf_d10
	tests/ref/seek/lavf_dv

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-20 22:18:26 +02:00
Justin Ruggles
b0e9edc44f avcodec: add a cook parser to get subpacket duration
Fixes jittery video playback of rm files with cook audio.
2012-04-20 12:11:20 -04:00
Michael Niedermayer
479fb7b8af Merge remote-tracking branch 'qatar/master'
* qatar/master: (35 commits)
  fix space type in Changelog
  ZeroCodec Decoder
  RealAudio Lossless decoder
  rtpenc: Use AVFormatContext.packet_size instead of a private option
  url: Document the expected behaviour of url_read
  libavformat: Use AVFormatContext.probesize in init_input
  docs: Fix a stray reference to tags in the generic doxy on dicts
  cosmetics: Align some AVInput/OutputFormat declarations
  zmbv: check decompress result
  zmbv: correct indentation
  adpcm: convert adpcm_thp to bytestream2.
  adpcm: convert adpcm_yamaha to bytestream2.
  adpcm: convert adpcm_swf to bytestream2.
  adpcm: convert adpcm_sbpro to bytestream2.
  adpcm: convert adpcm_ct to bytestream2.
  adpcm: convert adpcm_ima_amv/smjpeg to bytestream2.
  adpcm: convert adpcm_ea_xas to bytestream2.
  adpcm: convert adpcm_ea_r1/2/3 to bytestream2.
  adpcm: convert ea_maxis_xa to bytestream2.
  adpcm: convert adpcm_ea to bytestream2.
  ...

Conflicts:
	Changelog
	libavcodec/Makefile
	libavcodec/adpcm.c
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/version.h
	libavcodec/zerocodec.c
	libavcodec/zmbv.c
	libavformat/riff.c
	libavformat/url.h
	tests/ref/fate/truemotion1-15
	tests/ref/fate/truemotion1-24

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-20 00:03:19 +01:00
Kostya Shishkov
b8560637d9 RealAudio Lossless decoder 2012-03-19 18:46:34 +01:00
Michael Niedermayer
268098d8b2 Merge remote-tracking branch 'qatar/master'
* qatar/master: (29 commits)
  amrwb: remove duplicate arguments from extrapolate_isf().
  amrwb: error out early if mode is invalid.
  h264: change underread for 10bit QPEL to overread.
  matroska: check buffer size for RM-style byte reordering.
  vp8: disable mmx functions with sse/sse2 counterparts on x86-64.
  vp8: change int stride to ptrdiff_t stride.
  wma: fix invalid buffer size assumptions causing random overreads.
  Windows Media Audio Lossless decoder
  rv10/20: Fix slice overflow with checked bitstream reader.
  h263dec: Disallow width/height changing with frame threads.
  rv10/20: Fix a buffer overread caused by losing track of the remaining buffer size.
  rmdec: Honor .RMF tag size rather than assuming 18.
  g722: Fix the QMF scaling
  r3d: don't set codec timebase.
  electronicarts: set timebase for tgv video.
  electronicarts: parse the framerate for cmv video.
  ogg: don't set codec timebase
  electronicarts: don't set codec timebase
  avs: don't set codec timebase
  wavpack: Fix an integer overflow
  ...

Conflicts:
	libavcodec/arm/vp8dsp_init_arm.c
	libavcodec/fraps.c
	libavcodec/h264.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/msmpeg4.c
	libavcodec/pnmdec.c
	libavcodec/qpeg.c
	libavcodec/rawenc.c
	libavcodec/ulti.c
	libavcodec/vcr1.c
	libavcodec/version.h
	libavcodec/wmalosslessdec.c
	libavformat/electronicarts.c
	libswscale/ppc/yuv2rgb_altivec.c
	tests/ref/acodec/g722
	tests/ref/fate/ea-cmv

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 00:23:10 +01:00
Alex Converse
1697c29d75 rmdec: Honor .RMF tag size rather than assuming 18. 2012-03-02 09:31:32 -08:00
Diego Biurrun
75c553eb26 rmdec: adjust printf format string specifier to fix warning
libavformat/rmdec.c:383: warning: format ‘%d’ expects type ‘int’, but argument 7 has type ‘int64_t’
2012-03-01 23:11:14 +01:00
Michael Niedermayer
418403662b rmdec: fix "warning: format %d expects argument of type int, but argument 7 has type int64_t"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-25 02:33:30 +01:00
Michael Niedermayer
e99f1a8cc8 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  dxva2: don't check for DXVA_PictureParameters->wDecodedPictureIndex
  img2: split muxer and demuxer into separate files
  rm: prevent infinite loops for index parsing.
  aac: fix infinite loop on end-of-frame with sequence of 1-bits.
  mov: Add more HDV and XDCAM FourCCs.
  lavf: don't set AVCodecContext.has_b_frames in compute_pkt_fields().
  rmdec: when using INT4 deinterleaving, error out if sub_packet_h <= 1.
  cdxl: correctly synchronize video timestamps to audio
  mlpdec_parser: fix a few channel layouts.
  Add channel names to channel_names[] array for channels added in b2890f5
  movenc: Buffer the mdat for the initial moov fragment, too
  flvdec: Ignore the index if the ignidx flag is set
  flvdec: Fix indentation
  movdec: Don't parse all fragments if ignidx is set
  movdec: Restart parsing root-level atoms at the right spot
  prores: use natural integer type for the codebook index
  mov: Add support for MPEG2 HDV 720p24 (hdv4)
  swscale: K&R formatting cosmetics (part I)
  swscale: variable declaration and placement cosmetics

Conflicts:
	configure
	libavcodec/aacdec.c
	libavcodec/mlp_parser.c
	libavformat/flvdec.c
	libavformat/img2.c
	libavformat/isom.h
	libavformat/mov.c
	libavformat/movenc.c
	libswscale/rgb2rgb.c
	libswscale/rgb2rgb_template.c
	libswscale/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-23 04:31:55 +01:00
Ronald S. Bultje
aac07a7a4c rm: prevent infinite loops for index parsing.
Specifically, prevent jumping back in the file for the next index, since
this can lead to infinite loops where we jump between indexes referring
to each other, and don't read indexes that don't fit in the file.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-22 12:00:23 -08:00
Ronald S. Bultje
e30b3e59a4 rmdec: when using INT4 deinterleaving, error out if sub_packet_h <= 1.
We read sub_packet_h / 2 packets per line of data (during deinterleaving),
which equals zero if sub_packet_h <= 1, thus causing us to not read any
data, leading to an infinite loop.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-22 09:17:27 -08:00
Michael Niedermayer
e37f161e66 Merge remote-tracking branch 'qatar/master'
* qatar/master: (71 commits)
  movenc: Allow writing to a non-seekable output if using empty moov
  movenc: Support adding isml (smooth streaming live) metadata
  libavcodec: Don't crash in avcodec_encode_audio if time_base isn't set
  sunrast: Document the different Sun Raster file format types.
  sunrast: Add a check for experimental type.
  libspeexenc: use AVSampleFormat instead of deprecated/removed SampleFormat
  lavf: remove disabled FF_API_SET_PTS_INFO cruft
  lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft
  lavf: remove disabled FF_API_REORDER_PRIVATE cruft
  lavf: remove disabled FF_API_SEEK_PUBLIC cruft
  lavf: remove disabled FF_API_STREAM_COPY cruft
  lavf: remove disabled FF_API_PRELOAD cruft
  lavf: remove disabled FF_API_NEW_STREAM cruft
  lavf: remove disabled FF_API_RTSP_URL_OPTIONS cruft
  lavf: remove disabled FF_API_MUXRATE cruft
  lavf: remove disabled FF_API_FILESIZE cruft
  lavf: remove disabled FF_API_TIMESTAMP cruft
  lavf: remove disabled FF_API_LOOP_OUTPUT cruft
  lavf: remove disabled FF_API_LOOP_INPUT cruft
  lavf: remove disabled FF_API_AVSTREAM_QUALITY cruft
  ...

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

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-28 07:53:34 +01:00
Anton Khirnov
6e9651d106 lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Michael Niedermayer
757473831c Merge remote-tracking branch 'qatar/master'
* qatar/master: (29 commits)
  cabac: Move code only used within the CABAC test program into the test program.
  vp56: Drop unnecessary cabac.h #include.
  h264-test: Initialize AVCodecContext.av_class.
  build: Skip compiling network.h and rtsp.h if networking is not enabled.
  cosmetics: drop some pointless parentheses
  Disable annoying warning without changing behavior
  faq: Solutions for common problems with sample paths when running FATE.
  avcodec: attempt to clarify the CODEC_CAP_DELAY documentation
  avcodec: fix avcodec_encode_audio() documentation.
  FATE: xmv-demux test; exercise the XMV demuxer without decoding the perceptual codecs inside.
  vqf: recognize more metadata chunks
  FATE test: BMV demuxer and associated video and audio decoders.
  FATE: indeo4 video decoder test.
  FATE: update xxan-wc4 test to a sample with more code coverage.
  Change the recent h264_mp4toannexb bitstream filter test to output to an elementary stream rather than a program stream.
  g722enc: validate AVCodecContext.trellis
  g722enc: set frame_size, and also handle an odd number of input samples
  g722enc: split encoding into separate functions for trellis vs. no trellis
  mpegaudiodec: Use clearer pointer math
  tta: Fix returned error code at EOF
  ...

Conflicts:
	libavcodec/h264.c
	libavcodec/indeo3.c
	libavcodec/interplayvideo.c
	libavcodec/ivi_common.c
	libavcodec/libxvidff.c
	libavcodec/mpegvideo.c
	libavcodec/ppc/mpegvideo_altivec.c
	libavcodec/tta.c
	libavcodec/utils.c
	libavfilter/vsrc_buffer.c
	libavformat/Makefile
	tests/fate/indeo.mak
	tests/ref/acodec/g722

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-08 03:34:22 +01:00
Diego Biurrun
3dc99a18d4 cosmetics: drop some pointless parentheses 2012-01-07 22:13:07 +01:00
Michael Niedermayer
c4eec85a1f Revert "rmdec: Avoid allocating huge packets"
This reverts commit 66f71f3b5e.

This causes regressions with RDT.
2012-01-05 00:51:12 +01:00
Michael Niedermayer
66f71f3b5e rmdec: Avoid allocating huge packets
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-24 21:26:52 +01:00
Michael Niedermayer
9d76cf0b18 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtpdec: Templatize the code for different g726 bitrate variants
  rv40: move loop filter to rv34dsp context
  lavf: make av_set_pts_info private.
  rtpdec: Add support for G726 audio
  rtpdec: Add an init function that can do custom codec context initialization
  avconv: make copy_tb on by default.
  matroskadec: don't set codec timebase.
  rmdec: don't set codec timebase.
  avconv: compute next_pts from input packet duration when possible.
  lavf: estimate frame duration from r_frame_rate.
  avconv: update InputStream.pts in the streamcopy case.

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

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-01 02:54:24 +01:00
Anton Khirnov
c3f9ebf743 lavf: make av_set_pts_info private.
It's supposed to be called only from (de)muxers.
2011-11-30 20:34:45 +01:00
Anton Khirnov
d3e3ffa501 rmdec: don't set codec timebase.
It's not supposed to be set outside of lavc.
Set r_frame_rate instead.
2011-11-30 07:47:43 +01:00
Carl Eugen Hoyos
3880b4541a Do not claim that every unknown rm stream is a video stream.
Also reduce verbosity for the unsupported stream message, use
an AVFormatContext for av_log and and print the tag of the
unknown stream.

Improves ticket #672.
2011-11-25 00:06:19 +01:00
Michael Niedermayer
0bd42ae72c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avformat: Avoid a warning about mixed declarations and code
  BMV demuxer and decoder
  matroskaenc: Make sure the seekhead struct is freed even on seek failure
  mpeg12enc: Remove write-only variables.
  mpeg12enc: Don't set up run-level info for level 0.
  msmpeg4: Don't set up run-level info for level 0.
  avformat: Warn about using network functions without calling avformat_network_init
  avformat: Revise wording
  rdt: Set AVFMT_NOFILE on ff_rdt_demuxer
  rdt: Check the return value of avformat_open
  rtsp: Discard the dynamic handler, if it has an alloc function which failed
  dsputil: use cpuflags in x86 versions of vector_clip_int32()

Conflicts:
	libavcodec/avcodec.h
	libavcodec/version.h
	libavformat/Makefile
	libavformat/allformats.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-08 02:03:14 +01:00
Martin Storsjö
0882689116 rdt: Set AVFMT_NOFILE on ff_rdt_demuxer
This makes rdt work again, which has been broken since
603b8bc2a1. This commit made
opening a demuxer without a file (or in this case, with a filename
which can't be opened) fail, unless the demuxer actually declared
AVFMT_NOFILE.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-07 11:24:10 +02:00
Michael Niedermayer
d0492578c8 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  presets: rename presets directory
  lavc: make avcodec_get_context_defaults3 "officially" public
  lavf: replace av_new_stream->avformat_new_stream part II.
  lavf,lavd: replace av_new_stream->avformat_new_stream part I.
  lavf: add avformat_new_stream as a replacement for av_new_stream.
  Use correct scaling table for bwd-pred MVs in second B-field
  Ut Video decoder
  Makefile: change presets extension to .avpreset
  lavfi: add rgbtestsrc source, ported from MPlayer libmpcodecs
  lavfi: add testsrc source
  AVOptions: add documentation.
  presets: update libx264 ffpresets

Conflicts:
	Changelog
	doc/APIchanges
	doc/ffmpeg.texi
	ffpresets/libx264-ipod320.ffpreset
	ffpresets/libx264-ipod640.ffpreset
	ffserver.c
	libavcodec/avcodec.h
	libavcodec/options.c
	libavcodec/version.h
	libavdevice/libdc1394.c
	libavfilter/avfilter.h
	libavfilter/vsrc_testsrc.c
	libavformat/flvdec.c
	libavformat/riff.c
	libavformat/version.h
	libavformat/wtv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-20 02:34:51 +02:00
Anton Khirnov
3b3bbdd3e6 lavf,lavd: replace av_new_stream->avformat_new_stream part I.
Trivial replacements with sed are done in this commit:
sed 's/av_new_stream(\([^)]*\), 0)/avformat_new_stream(\1, NULL)/'
2011-10-19 17:02:11 +02:00
Michael Niedermayer
a6186f3a00 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  movenc: fix NULL reference in mov_write_tkhd_tag
  rmdec: Reject invalid deinterleaving parameters
  rv34: Fix potential overreads
  rv34: Fix buffer size used for MC of B frames after a resolution change
  rv34: Avoid NULL dereference on corrupted bitstream
  rv10: Reject slices that does not have the same type as the first one
  vf_yadif: add an option to enable/disable deinterlacing based on src frame "interlaced" flag
  vsrc_color: set output pos values to -1
  vsrc_color: add @file doxy
  vsrc_buffer: remove duplicated file description
  eval: implement not() expression
  eval: add sqrt function for computing the square root
  rmdec: use the deinterleaving mode and not the codec when creating audio packets.
  lavf: Fix context pointer in av_open_input_stream when avformat_open_input fails

Conflicts:
	doc/eval.texi
	doc/filters.texi
	libavcodec/rv10.c
	libavfilter/vsrc_color.c
	libavformat/rmdec.c
	libavutil/avutil.h
	libavutil/eval.c
	tests/ref/fate/eval

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-19 22:45:34 +02:00
Laurent Aimar
f06068bbd6 rmdec: Reject invalid deinterleaving parameters
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-09-19 15:45:22 +03:00
Laurent Aimar
3e033da847 rmdec: use the deinterleaving mode and not the codec when creating audio packets.
It prevents crashes due to non initialized fields.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-19 12:37:31 +02:00