Commit Graph

9715 Commits

Author SHA1 Message Date
Tomas Härdin 8c7721e709 mxfdec: Fix Avid AirSpeed files being misinterpreted as OP1a
The "ECs != 1 -> OP1a" assumption was wrong. Luckily, the file that triggered
that behavior had two ECs, not zero. Hence distinguishing between them is
simple in this case.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-08 00:39:56 +01:00
Tomas Härdin bf2290a80c mxfdec: Truncate packets that extend past the next edit unit
This fixes rare cases where OPAtom may be treated as OP1a, causing all essence
to be read into RAM.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-08 00:39:56 +01:00
Michael Niedermayer f095391a14 Merge remote-tracking branch 'qatar/master'
* qatar/master: (31 commits)
  cdxl demux: do not create packets with uninitialized data at EOF.
  Replace computations of remaining bits with calls to get_bits_left().
  amrnb/amrwb: Remove get_bits usage.
  cosmetics: reindent
  avformat: do not require a pixel/sample format if there is no decoder
  avformat: do not fill-in audio packet duration in compute_pkt_fields()
  lavf: Use av_get_audio_frame_duration() in get_audio_frame_size()
  dca_parser: parse the sample rate and frame durations
  libspeexdec: do not set AVCodecContext.frame_size
  libopencore-amr: do not set AVCodecContext.frame_size
  alsdec: do not set AVCodecContext.frame_size
  siff: do not set AVCodecContext.frame_size
  amr demuxer: do not set AVCodecContext.frame_size.
  aiffdec: do not set AVCodecContext.frame_size
  mov: do not set AVCodecContext.frame_size
  ape: do not set AVCodecContext.frame_size.
  rdt: remove workaround for infinite loop with aac
  avformat: do not require frame_size in avformat_find_stream_info() for CELT
  avformat: do not require frame_size in avformat_find_stream_info() for MP1/2/3
  avformat: do not require frame_size in avformat_find_stream_info() for AAC
  ...

Conflicts:
	doc/APIchanges
	libavcodec/Makefile
	libavcodec/avcodec.h
	libavcodec/h264.c
	libavcodec/h264_ps.c
	libavcodec/utils.c
	libavcodec/version.h
	libavcodec/x86/dsputil_mmx.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-06 06:03:32 +01:00
Reimar Döffinger 632eb1bbae cdxl demux: do not create packets with uninitialized data at EOF.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-03-05 16:27:31 -05:00
Derek Buitenhuis 01606d10e6 libutvideo: Add Ut Video encoder wrapper
All colorspaces are supported.

Renamed libutvideo.cpp to libutvideodec.cpp.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-05 22:25:49 +01:00
Justin Ruggles 94cf64b81f cosmetics: reindent 2012-03-05 13:08:19 -05:00
Justin Ruggles 8c1d6ac66a avformat: do not require a pixel/sample format if there is no decoder
Also, do not keep trying to find and open a decoder in try_decode_frame() if
we already tried and failed once.

Fixes always searching until max_analyze_duration in
avformat_find_stream_info() when demuxing codecs without a decoder.
2012-03-05 13:08:18 -05:00
Justin Ruggles a7fa75684d avformat: do not fill-in audio packet duration in compute_pkt_fields()
Use the estimated duration only to calculate missing timestamps if needed.
2012-03-05 13:08:18 -05:00
Justin Ruggles 6c65cf58fd lavf: Use av_get_audio_frame_duration() in get_audio_frame_size()
Also, do not give AVCodecContext.frame_size priority for muxing.

Updated 2 FATE references:
dxa-feeble - adds 1 audio frame that is still within 2 seconds as specified
             by -t 2 in the FATE test
wmv8-drm-nodec - durations are not needed. previously they were estimated
                 using the packet size and average bit rate.
2012-03-05 13:08:18 -05:00
Justin Ruggles f1e73100d9 siff: do not set AVCodecContext.frame_size
also, properly set AVCodecContext.bits_per_coded_sample, AVStreasm.start_time,
and AVPacket.duration.
2012-03-05 13:08:17 -05:00
Justin Ruggles ec2e767bf3 amr demuxer: do not set AVCodecContext.frame_size.
it is not necessary.
2012-03-05 13:08:17 -05:00
Justin Ruggles 8d1a20aa7c aiffdec: do not set AVCodecContext.frame_size
It is unnecessary. Also, for some codecs we're reading more than 1 frame per
packet. Instead we use a private context variable to calculate the bit rate,
stream duration, and packet durations.

Updated FATE seek test, which has slightly different timestamps due to a
more accurate bit rate calculation.
2012-03-05 13:08:17 -05:00
Justin Ruggles 237a855caf mov: do not set AVCodecContext.frame_size
It is not necessary.
2012-03-05 13:08:17 -05:00
Justin Ruggles 9727264220 ape: do not set AVCodecContext.frame_size.
prevents lavf from setting incorrect packet durations.
2012-03-05 13:08:17 -05:00
Justin Ruggles 2dd18d4435 rdt: remove workaround for infinite loop with aac
avformat_find_stream_info() no longer hangs while waiting for AAC frame_size
2012-03-05 13:08:16 -05:00
Justin Ruggles 9c365fe8ae avformat: do not require frame_size in avformat_find_stream_info() for CELT
In Ogg/CELT, frame_size is found in the same place as the sample_rate and
channels, so we do not need to force the frame_size to be parsed.
2012-03-05 13:08:16 -05:00
Justin Ruggles fbc8c59679 avformat: do not require frame_size in avformat_find_stream_info() for MP1/2/3
It was only needed to avoid a bad time base (and thus non-monotone timestamps)
for stream copy to avi.
2012-03-05 13:08:16 -05:00
Justin Ruggles 84b6ae0808 avformat: do not require frame_size in avformat_find_stream_info() for AAC
We already will get the needed info because of CODEC_CAP_CHANNEL_CONF
2012-03-05 13:08:16 -05:00
Justin Ruggles 620b88a302 swfenc: use av_get_audio_frame_duration() instead of AVCodecContext.frame_size
This way we can do stream copy without having the demuxer wait until
frame_size has been set.
2012-03-05 13:08:16 -05:00
Justin Ruggles 14aecc50fa rtpenc: use av_get_audio_frame_duration() for max_frames_per_packet
It is more reliable than AVCodecContext.frame_size for codecs with constant
packet duration.
2012-03-05 13:08:16 -05:00
Justin Ruggles c019070fda riffenc: use av_get_audio_frame_duration()
For encoding, frame_size is not a reliable indicator of packet duration.
Also, we don't want to have to force the demuxer to find frame_size for
stream copy to work.
2012-03-05 13:08:15 -05:00
Aaron Colwell 2e061130f4 matroska : Add support for reading/writing creation_time metadata.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-05 19:02:48 +01:00
Anton Khirnov 27c7ca9c12 lavf: deobfuscate read_frame_internal().
Split off packet parsing into a separate function. Parse full packets at
once and store them in a queue, eliminating the need for tracking
parsing state in AVStream.

The horrible unreadable loop in read_frame_internal() now isn't weirdly
ordered and doesn't contain evil gotos, so it should be much easier to
understand.

compute_pkt_fields() now invents slightly different timestamps for two
raw vc1 tests, due to has_b_frames being set a bit later. They shouldn't
be more wrong (or right) than previous ones.
2012-03-05 18:47:05 +01:00
Anton Khirnov dcee811505 lavf: make read_from_packet_buffer() more flexible.
Make packet buffer a parameter, don't hardcode it to be
AVFormatContext.packet_buffer.

Also move the function higher in the file, since it will be called from
read_frame_internal().
2012-03-05 18:44:45 +01:00
Anton Khirnov 52b0943f10 lavf: factorize freeing a packet buffer. 2012-03-05 18:44:30 +01:00
Diego Biurrun 0a41f47dc1 dv: Do not redundantly initialize struct members to zero. 2012-03-05 17:02:59 +01:00
Michael Niedermayer 337fa0dbe7 lavf: Do not compute the packet duration based on the bitrate if the frame_size can be determined.
This fixes issues when the bitrate is variable or inaccurate but the
frame size has not been determined yet.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-04 04:27:01 +01:00
Michael Niedermayer b8afbbca9c lavf: factor out determinable_frame_size()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-04 04:26:12 +01:00
Michael Niedermayer 15c6be8c7d Merge remote-tracking branch 'qatar/master'
* qatar/master:
  tiertexseq: set correct block_align for audio
  tiertexseq: set audio stream start time to 0
  voc/avs: Do not change the sample rate mid-stream.
  segafilm: use the sample rate as the time base for audio streams
  ea: fix audio pts
  psx-str: fix audio pts
  vqf: set packet duration
  tta demuxer: set packet duration
  mpegaudio_parser: do not ignore information from the first parsed frame
  mpegaudio_parser: be less picky about the start position
  thp: set audio packet durations
  avcodec: add a Vorbis parser to get packet duration
  vorbisdec: read the previous window flag for long windows
  lavc: free the output packet when encoding failed or produced no output.
  lavc: preserve avpkt->destruct in ff_alloc_packet().
  lavc: clarify the meaning of AVCodecContext.frame_number.
  mpegts: Pad the packet buffer in handle_packet().
  mpegts: Do not call read_sl_header() when no bytes remain in the buffer.

Conflicts:
	libavcodec/mpegaudio_parser.c
	libavcodec/version.h
	libavformat/mpegts.c
	tests/ref/fate/pva-demux

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-04 04:26:04 +01:00
Justin Ruggles b7beabab4b tiertexseq: set correct block_align for audio 2012-03-03 17:03:27 -05:00
Justin Ruggles f9cf91d822 tiertexseq: set audio stream start time to 0
Update FATE test to reflect delayed video due to the file having audio-only
frames prior to the first frame with video.
2012-03-03 17:03:27 -05:00
Justin Ruggles 0883109b27 voc/avs: Do not change the sample rate mid-stream.
Also, set the time base based on the sample rate.
lavf-voc seek test updated to reflect slightly different seek points.
2012-03-03 17:03:27 -05:00
Justin Ruggles 4da374f8a9 segafilm: use the sample rate as the time base for audio streams 2012-03-03 17:03:27 -05:00
Justin Ruggles ea289186f0 ea: fix audio pts
The time base is 1 / sample_rate, not 90000.
Several more codecs encode the sample count in the first 4 bytes of the
chunk, so we set the durations accordingly. Also, we can set start_time and
packet duration instead of keeping track of the sample count in the demuxer.
2012-03-03 17:03:27 -05:00
Justin Ruggles 01be6fa926 psx-str: fix audio pts
Each packet has 18 sectors with 224/channels samples in each sector.
2012-03-03 17:03:27 -05:00
Justin Ruggles d0ab585074 vqf: set packet duration
Fixes timestamp calculation.
The FATE reference is updated because timestamp calculations are now more
accurate. Previous timestamps were based on average bit rate.
2012-03-03 17:03:26 -05:00
Justin Ruggles 101c369b7c tta demuxer: set packet duration 2012-03-03 17:03:26 -05:00
Justin Ruggles 5a9b952201 thp: set audio packet durations 2012-03-03 16:58:45 -05:00
Justin Ruggles 5602a464c9 avcodec: add a Vorbis parser to get packet duration
This also allows for removing some of the Vorbis-related hacks.
2012-03-03 16:43:11 -05:00
Michael Niedermayer f83687bc78 mpegts: fix stack array overread in read_sl_header()
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 21:03:11 +01:00
Michael Niedermayer 4a310a19de mpegts: prevent get_bits64() from reading nonsense at the end.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 21:02:17 +01:00
Michael Niedermayer e732d0f608 mpeg-ts: fix handling of size=0 SL headers.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 18:35:46 +01:00
Petri Hintukainen 23a5bf9db0 bluray protocol
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-03 04:30:49 +01:00
Alex Converse 1aa708988a mpegts: Pad the packet buffer in handle_packet().
This allows it to be used with get_bits without the thread of overreads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-02 15:44:42 -08:00
Alex Converse 4df369692e mpegts: Do not call read_sl_header() when no bytes remain in the buffer.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-02 15:44:42 -08: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
Ronald S. Bultje 9c239f6026 matroska: check buffer size for RM-style byte reordering.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-03-02 10:32:22 -08:00
Alex Converse 1697c29d75 rmdec: Honor .RMF tag size rather than assuming 18. 2012-03-02 09:31:32 -08:00
Anton Khirnov 56bf24ad78 r3d: don't set codec timebase.
It's not supposed to be set by demuxers.

Set avg_frame_rate and r_frame_rate instead.
2012-03-02 17:21:45 +01:00
Anton Khirnov efec3bc65a electronicarts: set timebase for tgv video.
The container has no timestamps and the framerate isn't stored in the
data either.
The decoder sets codec timebase to experimentally found value 1/15. Do
the same for the demuxer too, it should at least be better than the
default 1/90000.
2012-03-02 11:11:38 +01:00