Commit Graph

10027 Commits

Author SHA1 Message Date
Jean First 64943b47e7 lavf remove duplicated check in has_duration
this hunk was merged in 8b97ae64 and cbf767a8 although the check was there a
few lines above since cdced09e. I removed the first check to reduce the differences
to libav.

Signed-off-by: Jean First <jeanfirst@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-28 19:07:30 +02:00
Nicolas George 12eeced8b4 avio: change ffurl_alloc return code.
If the designated protocol is not found, return
AVERROR_PROTOCOL_NOT_FOUND instead of AVERROR(ENOENT).
2012-04-28 16:39:54 +02:00
Michael Niedermayer 28c5775183 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpegts: Make sure we don't return uninitialized packets
  gitignore: replace library catch-all pattern by more specific patterns

Conflicts:
	.gitignore

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-27 22:44:52 +02:00
Clément Bœsch e40981b8c4 lavf/microdvd: set packet duration. 2012-04-27 19:19:36 +02:00
Martin Storsjö df8aa4598c mpegts: Make sure we don't return uninitialized packets
This fixes crashes, where the demuxer could return 0 even
if the returned AVPacket isn't initialized at all. This
could happen if running into EOF or running out of probesize
with non-seekable sources.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-27 20:05:37 +03:00
Michael Niedermayer e890b68962 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  dsputil: fix invalid array indexing
  configure: add libavresample to rpath
  build: icc: silence some warnings
  fft-test: add option to set cpuflag mask
  cpu: recognise only cpu flag names pertinent to the architecture
  avutil: add av_parse_cpu_flags() function
  vp8: armv6: fix non-armv6t2 build
  vp8: armv6 optimisations
  vp8: arm: separate ARMv6 functions from NEON
  ARM: add some compatibility macros
  mov: support eac3 audio
  avf: fix faulty check in has_duration

Conflicts:
	configure
	doc/APIchanges
	ffmpeg.c
	libavcodec/arm/Makefile
	libavcodec/arm/asm.S
	libavcodec/arm/vp8dsp_armv6.S
	libavcodec/arm/vp8dsp_init_arm.c
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-26 22:24:58 +02:00
Hendrik Leppkes 949d942eef mov: support eac3 audio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-04-25 15:24:14 -04:00
Luca Barbato 8b97ae6484 avf: fix faulty check in has_duration
An invalid duration is AV_NOPTS_VALUE not 0.
2012-04-25 11:40:22 -07:00
Michael Niedermayer 8f89954550 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avconv: fix a segfault on -c copy with -filter_complex.
  isom: Support more DTS codec identifiers.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-24 23:45:09 +02:00
Michael Niedermayer 3bbf3f7e42 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  matroska: Clear prev_pkt between seeks.
  avutil: change default buffer size alignment for sample buffer functions
  audemux: Add a sanity check for the number of channels
  Remove libdirac decoder.
  matroska: Add incremental parsing of clusters.
  avconv: fix off by one check in complex_filter
  mpegts: Try seeking back even for nonseekable protocols
  swscale: K&R formatting cosmetics (part III)

Conflicts:
	configure
	doc/general.texi
	doc/platform.texi
	ffmpeg.c
	libavcodec/Makefile
	libavcodec/allcodecs.c
	libavcodec/libdirac.h
	libavcodec/libdiracdec.c
	libavformat/au.c
	libavformat/mpegts.c
	libswscale/input.c
	tests/ref/seek/lavf_mkv

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-24 02:30:41 +02:00
Yusuke Nakamura 462a5b7839 isom: Support more DTS codec identifiers.
DTS LBR identifier ('dtse') is not included since libavcodec doesn't support it yet.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-04-23 14:47:17 -04:00
Dale Curtis 7521c4bab2 matroska: Clear prev_pkt between seeks.
The new incremental parser doesn't always clear prev_pkt,
however the packet queue is cleared when seeking. Which leads
to a use-after-free.

Verified using Valgrind.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-04-23 14:21:42 -04:00
Nicolas George 73bc019baf lavf: print a warning if probesize seems not enough. 2012-04-23 12:26:19 +02:00
Michael Niedermayer 0ca4414d0f audemux: Add a sanity check for the number of channels
Fixes a division by 0.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-23 10:47:38 +03:00
Dale Curtis 8336eb6f85 matroska: Add incremental parsing of clusters.
Reduces the amount of upfront data required for cluster parsing
thus decreasing latency on seek and startup.

The change in the seek-lavf_mkv FATE test is due to incremental
parsing no longer reading as much data as the old parser and
thus not having that additional data to generate index entries
based on keyframes.  Index entries are added correctly as the
file is parsed.

All FATE tests pass and Chrome has been using this patch for ~6
months without issue.

Currently incremental parsing is not supported for files with
SSA tracks since they require merging packets between clusters.
In this case the code falls back to non-incremental parsing.

Signed-off-by: Aaron Colwell <acolwell@chromium.org>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-04-22 17:23:50 -07:00
Martin Storsjö 269cb6751b mpegts: Try seeking back even for nonseekable protocols
The mpegts demuxer reads 5 KB at startup just for discovering
the packet size. Since the default avio buffer size is 32 KB,
the seek back to the start will in most cases be within the
avio buffer, and will in most cases succeed even if the actual
protocol isn't seekable.

This makes the demuxer startup faster/with less data when
reading data from a non-seekable input, by not skipping
the first few KB.

If it fails, don't warn if the protocol isn't seekable, making
it behave as before in the failure case.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-23 00:02:49 +03:00
Michael Niedermayer 92ef4be4ab Merge remote-tracking branch 'qatar/master'
* qatar/master:
  ARM: allow runtime masking of CPU features
  dsputil: remove unused functions
  mov: Treat keyframe indexes as 1-origin if starting at non-zero.
  mov: Take stps entries into consideration also about key_off.
  Remove lowres video decoding

Conflicts:
	ffmpeg.c
	ffplay.c
	libavcodec/arm/vp8dsp_init_arm.c
	libavcodec/libopenjpegdec.c
	libavcodec/mjpegdec.c
	libavcodec/mpegvideo.c
	libavcodec/utils.c
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-22 22:26:42 +02:00
Michael Niedermayer 52fdaf27f7 audemux: Fix potential integer overflow leading to a division by 0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-22 15:34:21 +02:00
Michael Niedermayer 8aa57b7b5e audemux: Check channels isnt 0
Fixes a division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-22 15:34:15 +02:00
Michael Niedermayer fd2127ad53 wtvdec: Check that stream private context has been allocated before use.
This fixes a null ptr dereference with attachments

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-22 15:29:34 +02:00
Michael Niedermayer 2a59abf1a8 smackerdemux: Allocate padding for extradata
Fixes slight overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-22 11:23:58 +02:00
Michael Niedermayer c047afb80c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avcodec: remove AVCodecContext.dsp_mask
  avconv: fix a segfault when default encoder for a format doesn't exist.
  utvideo: general cosmetics
  aac: Handle HE-AACv2 when sniffing a channel order.
  movenc: Support high sample rates in isomedia formats by setting the sample rate field in stsd to 0.
  xxan: Remove write-only variable in xan_decode_frame_type0().
  ivi_common: Initialize a variable at declaration in ff_ivi_decode_blocks().

Conflicts:
	ffmpeg.c
	libavcodec/utvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-21 22:56:07 +02:00
Yusuke Nakamura 94c9bf8887 mov: Treat keyframe indexes as 1-origin if starting at non-zero.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-04-21 14:04:33 -04:00
Yusuke Nakamura ba9869311f mov: Take stps entries into consideration also about key_off.
Splitted files don't start always from a sync sample.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-04-21 14:04:33 -04:00
Michael Niedermayer 80d51680b2 xmvdemux: prefer av_freep() to deallocate audio stream structs.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-21 19:42:44 +02:00
Michael Niedermayer 13381577d1 xmvdemux: dont let current_stream become invalid.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-21 19:41:54 +02:00
Alex Converse dc878b96a7 movenc: Support high sample rates in isomedia formats by setting the sample rate field in stsd to 0.
Libisomediafile appears to always set this field to zero.
2012-04-20 13:45:35 -07: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
Reimar Döffinger dd5e1fc22e mxfdec: fix memleak on read error/EOF.
This also matches the rest of the demuxer which will return
partial packets.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-04-20 20:58:45 +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 455fcf29b8 avidec: zero extradata padding
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-19 22:52:34 +02:00
Michael Niedermayer ee402df9a2 mtvdec: check that the buf is large enough for probing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-19 22:11:19 +02:00
Michael Niedermayer 2a70d8304d jvdec: Make sure there is enough data for the id string.
Previously too little data could lead to a false detection.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-19 21:43:15 +02:00
Michael Niedermayer 2a976debc1 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  dv: Initialize encoder tables during encoder init.
  dv: Replace some magic numbers by the appropriate #define.
  FATE: pass the decoded output format and audio source file to enc_dec_pcm
  FATE: specify the input format when decoding in enc_dec_pcm()
  x86inc: support AVX abstraction for 2-operand instructions
  configure: detect PGI compiler and set suitable flags
  avconv: check for an incompatible changing channel layout
  avio: make AVIOContext.av_class pointer to const
  nutdec: add malloc check and fix const to non-const conversion warnings

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-19 21:23:52 +02:00
Matthieu Bouron cbda76c7c6 mxfdec: Add missing break in frame layout parsing
Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-19 15:08:22 +02:00
Matthieu Bouron 70ca163bc5 mxf: Fix frame layout values
Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-19 15:08:13 +02:00
Mans Rullgard 6208313aeb avio: make AVIOContext.av_class pointer to const
Fix this warning:
libavformat/aviobuf.c:663:20: warning: assignment discards qualifiers from pointer target type

Although this is a public header, it should remain source and
binary compatible.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-18 23:54:20 +01:00
Mans Rullgard 9d72c0527c nutdec: add malloc check and fix const to non-const conversion warnings
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-18 23:54:20 +01:00
Michael Niedermayer e366e6bfab Merge remote-tracking branch 'qatar/master'
* qatar/master:
  ppc: drop unused function dct_quantize_altivec()
  mpegaudiodec: Do not discard mp_decode_frame() return value.
  matroska: do not set invalid default duration if frame rate is zero
  mkv: use av_reduce instead of av_d2q for framerate estimation
  mkv: report average framerate as minimal as well
  avcodec_string: Favor AVCodecContext.codec over the default codec.
  cook: Make constants passed to AV_BE2NE32C() unsigned to avoid signed overflow.

Conflicts:
	libavcodec/cook.c
	libavcodec/ppc/mpegvideo_altivec.c
	libavcodec/utils.c
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-18 22:08:28 +02:00
Michael Niedermayer 9ed388f598 ogm: Fix division by 0
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-18 15:30:34 +02:00
Michael Niedermayer 9f39d3d190 lavf: check that the context to avformat_open_input() is valid.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-18 15:30:34 +02:00
Mans Rullgard 3c58300269 matroska: do not set invalid default duration if frame rate is zero
If a video track specifies a zero frame rate (invalid but occurs),
this results in a division by zero and subsequent undefined conversion
to integer.  Setting the default duration from the frame rate only
if the latter is greater than zero avoids such problems.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-04-18 13:48:20 +01:00
Luca Barbato ac97d47d9b mkv: use av_reduce instead of av_d2q for framerate estimation
It avoids some rounding errors.
2012-04-17 16:37:42 -07:00
Luca Barbato 204bcdf56c mkv: report average framerate as minimal as well
This is in line with other demuxers and overall seems more correct
than assuming codec time base.
2012-04-17 15:47:22 -07:00
Michael Niedermayer 1232723741 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  aacenc: Fix issues with huge values of bit_rate.
  dv_tablegen: Drop unnecessary av_unused attribute from dv_vlc_map_tableinit().
  proresenc: multithreaded quantiser search
  riff: use bps instead of bits_per_coded_sample in the WAVEFORMATEXTENSIBLE header
  avconv: only set the "channels" option when it exists for the specified input format
  avplay: update get_buffer to be inline with avconv
  aacdec: More robust output configuration.
  faac: Fix multi-channel ordering
  faac: Add .channel_layouts
  rtmp: Support 'rtmp_playpath', an option which overrides the stream identifier
  rtmp: Support 'rtmp_app', an option which overrides the name of application
  avutil: add better documentation for AVSampleFormat

Conflicts:
	libavcodec/aac.h
	libavcodec/aacdec.c
	libavcodec/aacenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-18 00:28:06 +02:00
Michael Niedermayer 096231d497 avidec: Dont crash on avi packets that belong to dv streams in dv in avi
Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-17 17:58:19 +02:00
Michael Niedermayer 9789b6ca48 avidec: document early_exit argument
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-17 17:58:19 +02:00
Michael Niedermayer 2677697ac9 matroskadec: check headerstrip data availability.
Fixes null ptr dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-17 17:58:19 +02:00
Michael Niedermayer c7c976c6d7 oggdec: Safety check against stream counts being inconsistent in seek()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-17 14:44:06 +02:00
Michael Niedermayer 9bb3b7d028 oggdec: Recreate streams only in the 1 stream case.
Other cases are not supported and lead to inconsistencies which
can lead to out of array writes.

Reported-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-17 14:03:26 +02:00