Commit Graph

9414 Commits

Author SHA1 Message Date
Anton Khirnov
cc10ab79ec lavf: remove disabled FF_API_FIND_INFO_TAG cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov
ecd5f41a06 lavf: remove disabled FF_API_PARSE_DATE cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov
997420abf2 lavf: remove disabled FF_API_DUMP_FORMAT cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov
2fb7501938 lavf: remove disabled FF_API_FORMAT_PARAMETERS cruft
Also remove now unused AVFormatParameters struct and
AVOutputFormat.set_parameters().
2012-01-27 10:52:42 +01:00
Anton Khirnov
38233fc131 lavf: remove disabled FF_API_OLD_METADATA2 cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov
2439f2ca82 lavf: remove disabled FF_API_OLD_AVIO cruft 2012-01-27 10:52:42 +01:00
Anton Khirnov
a17479dfce lavf: increase major version from 53 to 54. 2012-01-27 10:52:39 +01:00
Anton Khirnov
6e9651d106 lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Michael Niedermayer
01fcbdf9ce Merge remote-tracking branch 'qatar/master'
* qatar/master:
  smacker: Sanity check huffman tables found in the headers.
  smacker: remove dead store
  qdm2: Check data block size for bytes to bits overflow.
  mxfdec: Fix files with essence containers larger than 2 GiB.
  mxfdec: Employ correct printf conversion specifiers for POSIX int types.
  vc1: always read the bfraction element for interlaced fields
  fate: add XWD image regression test
  lavf: prevent infinite loops while flushing in avformat_find_stream_info
  matroskadec: Pad AAC extradata.
  ismindex: Fix build on mingw

Conflicts:
	libavformat/mxfdec.c
	libavformat/utils.c
	tests/lavf-regression.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-27 02:09:58 +01:00
Michael Niedermayer
88d84dd8ea dv: Fix out of array read
Fixes part of CVE-2011-3936

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-26 20:10:26 +01:00
Michael Niedermayer
8847561f93 mov: Fix seeking regression in fragemnted movs.
Regression introduced in 550f7c43ec

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-26 20:10:25 +01:00
Michael Niedermayer
1860c66c54 matroskadec: increase padding on several more extradata allocations.
Inspired by: 5af569aa30 by alex
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-26 17:23:41 +01:00
Alex Converse
5af569aa30 matroskadec: Pad AAC extradata.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

CC: libav-stable@libav.org
(cherry picked from commit d2ee8c1779)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-26 17:16:33 +01:00
Tomas Härdin
62271c4c9a mxfdec: Fix files with essence containers larger than 2 GiB.
For such files, accumulating into an int would cause an overflow.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-01-26 15:47:50 +01:00
Jean First
4fbd3e89e7 mxfdec: Employ correct printf conversion specifiers for POSIX int types.
Signed-off-by: Jean First <jeanfirst@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-01-26 15:31:55 +01:00
Michael Niedermayer
3c5fe5b527 Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
  wma: Clip WMA1 and WMA2 frame length to 11 bits.
  movenc: Don't require frame_size to be set for modes other than mov
  doc: Update APIchanges with info on muxer flushing
  movenc: Reindent a block
  tools: Remove some unnecessary #undefs.
  rv20: prevent calling ff_h263_decode_mba() with unset height/width
  tools: K&R reformatting cosmetics
  Ignore generated aviocat and ismindex tools.
  build: Automatically include architecture-specific library Makefile snippets.
  indeo5: prevent null pointer dereference on broken files
  pktdumper: Use usleep instead of sleep
  cosmetics: Remove some unnecessary block braces.
  Drop unnecessary prefix from *sink* variable and struct names.
  Add a tool for creating smooth streaming manifests
  movdec: Calculate an average bit rate for fragmented streams, too
  movenc: Write the sample rate instead of time scale in the stsd atom
  movenc: Add a separate ismv/isma (smooth streaming) muxer
  movenc: Allow the caller to decide on fragmentation
  libavformat: Add a flag for muxers that support write_packet(NULL) for flushing
  movenc: Add support for writing fragmented mov files
  ...

Conflicts:
	Changelog
	cmdutils.c
	cmdutils.h
	doc/APIchanges
	ffmpeg.c
	ffplay.c
	libavfilter/Makefile
	libavformat/Makefile
	libavformat/avformat.h
	libavformat/movenc.c
	libavformat/movenc.h
	libavformat/version.h
	tools/graph2dot.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-26 02:23:56 +01:00
Janne Grunau
b3461c29c1 lavf: prevent infinite loops while flushing in avformat_find_stream_info
If no data was seen for a stream decoder are returning 0 when fed with
empty packets for flushing. We can stop flushing when the decoder does
not return delayed delayed frames anymore. Changes try_decode_frame()
return value to got_picture or negative error.

CC: libav-stable@libav.org
2012-01-26 00:45:05 +01:00
Alex Converse
d2ee8c1779 matroskadec: Pad AAC extradata.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

CC: libav-stable@libav.org
2012-01-25 14:46:06 -08:00
Martin Storsjö
9f9c45f4b6 movenc: Don't require frame_size to be set for modes other than mov
The field frame_size isn't written to the output anywhere except
than in mov.

This facilitates stream copy from formats that don't set frame_size.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 22:25:56 +02:00
Martin Storsjö
990a746cec movenc: Reindent a block
Also add some space around operators and wrap a comment
that extends past the 80 char "limit"/guideline.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 22:13:56 +02:00
Michael Niedermayer
5cb57a16ed dv: Fix null pointer dereference due to ach=0
Fixes part2 of CVE-2011-3929

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Roman Shaposhnik <roman@shaposhnik.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-25 16:41:27 +01:00
Michael Niedermayer
f9de136b17 dv: check stype
Fixes part1 of CVE-2011-3929
Possibly fixes part of CVE-2011-3936

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Roman Shaposhnik <roman@shaposhnik.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-25 16:41:26 +01:00
Martin Storsjö
33ec9ef96d Add a tool for creating smooth streaming manifests
It can also optionally split the file into individual fragments,
which allows it to be served from any web server without any
server side support.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 12:15:42 +02:00
Martin Storsjö
bc7d05177f movdec: Calculate an average bit rate for fragmented streams, too
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 12:15:41 +02:00
Martin Storsjö
3b5d4428ac movenc: Write the sample rate instead of time scale in the stsd atom
For ismv/isma, the time scale might not be the same as the sample
rate.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 12:15:41 +02:00
Martin Storsjö
4ddd54dab4 movenc: Add a separate ismv/isma (smooth streaming) muxer
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 12:15:41 +02:00
Martin Storsjö
b613ff5e93 movenc: Allow the caller to decide on fragmentation
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 12:15:41 +02:00
Martin Storsjö
f1caf01d5e libavformat: Add a flag for muxers that support write_packet(NULL) for flushing
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 12:15:41 +02:00
Martin Storsjö
83988d58ed movenc: Add support for writing fragmented mov files
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 12:15:41 +02:00
Martin Storsjö
6ca3856894 movenc: Add a separate start_pts
This fixes calculation of trackDuration if the MOVIentry array
is cleared. This is required by the fragmentation support in the
next patch.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 12:15:40 +02:00
Michael Niedermayer
28d634711b avidec: Fix regression with chunks that are larger than the file.
This commit makes the check specific to the case that needs it.

Regression was introduced by
commit 62adc60b97
Author: Michael Niedermayer <michaelni@gmx.at>
Date:   Fri Dec 16 06:13:04 2011 +0100

    avidec: Check that the header chunks fit in the available filesize.
    Fixes Ticket771
    Bug found by: Diana Elena Muscalu

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-25 06:48:30 +01:00
Michael Niedermayer
5c011706bc nsvdec: Fix use of uninitialized streams.
Fixes CVE-2011-3940 (Out of bounds read resulting in out of bounds write)

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-25 06:48:30 +01:00
Michael Niedermayer
1d9569f9e8 Merge remote-tracking branch 'qatar/master'
* qatar/master: (23 commits)
  aacenc: Fix identification padding when the bitstream is already aligned.
  aacenc: Write correct length for long identification strings.
  aud: remove unneeded field, audio_stream_index from context
  aud: fix time stamp calculation for ADPCM IMA WS
  aud: simplify header parsing
  aud: set pts_wrap_bits to 64.
  cosmetics: indentation
  aud: support Westwood SND1 audio in AUD files.
  adpcm_ima_ws: fix stereo decoding
  avcodec: add a new codec_id for CRYO APC IMA ADPCM.
  vqa: remove unused context fields, audio_samplerate and audio_bits
  vqa: clean up audio header parsing
  vqa: set time base to frame rate as coded in the header.
  vqa: set packet duration.
  vqa: use 1/sample_rate as the audio stream time base
  vqa: set stream start_time to 0.
  lavc: postpone the removal of AVCodecContext.request_channels.
  lavf: postpone removing av_close_input_file().
  lavc: postpone removing old audio encoding and decoding API
  avplay: remove the -er option.
  ...

Conflicts:
	Changelog
	libavcodec/version.h
	libavdevice/v4l.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-24 22:53:59 +01:00
Carl Eugen Hoyos
76c3e76eb3 Allow user to force reading mov alias from absolute path.
Based on a work-around by Alex Zhukov.

Fixes ticket #935
2012-01-24 22:39:54 +01:00
Justin Ruggles
b8dd555c63 aud: remove unneeded field, audio_stream_index from context
There is only one stream, so it will always be index 0.
This also allows for removal of the private context.
2012-01-24 14:13:47 -05:00
Justin Ruggles
be14a37066 aud: fix time stamp calculation for ADPCM IMA WS
also allows for removing some unused context fields
2012-01-24 14:13:47 -05:00
Justin Ruggles
10fef6bd6b aud: simplify header parsing
also allows for removing some unused context fields
2012-01-24 14:13:47 -05:00
Justin Ruggles
0e6a8b5cf7 aud: set pts_wrap_bits to 64.
Time stamps are not read from the bitstream, so no wrapping is needed.
2012-01-24 14:13:47 -05:00
Justin Ruggles
98c290cc08 cosmetics: indentation 2012-01-24 14:13:46 -05:00
Justin Ruggles
d481227c54 aud: support Westwood SND1 audio in AUD files.
Fixes decoding of the handful of "death scream" samples from
"Command and Conquer" that use SND1. e.g.
http://samples.libav.org/game-formats/westwood-aud/nuyell1.aud
http://samples.libav.org/game-formats/westwood-aud/nuyell7.aud
2012-01-24 14:13:46 -05:00
Justin Ruggles
02e7dbf5ad adpcm_ima_ws: fix stereo decoding
Stereo ADPCM IMA WS is planar for VQA version 3 and 2-sample interleaved for
VQA version 2.
2012-01-24 14:13:46 -05:00
Justin Ruggles
220506d23f avcodec: add a new codec_id for CRYO APC IMA ADPCM.
The stereo layout and extradata is significantly different from that in
Westwood IMA ADPCM, so a separate codec_id is warranted.
2012-01-24 14:13:41 -05:00
Justin Ruggles
4340a6363e vqa: remove unused context fields, audio_samplerate and audio_bits 2012-01-24 14:08:29 -05:00
Justin Ruggles
7e813d5933 vqa: clean up audio header parsing
Fix setting of bit_rate and bits_per_coded_sample.
Ask for sample for unsupported VQA versions.
2012-01-24 14:08:29 -05:00
Justin Ruggles
5b4c562897 vqa: set time base to frame rate as coded in the header.
According to Multimedia Wiki documentation, the frame rate is not always 15,
and the actual value can be found in the header.
2012-01-24 14:08:29 -05:00
Justin Ruggles
9ae846971f vqa: set packet duration.
Also remove unused context field, audio_frame_counter.
2012-01-24 14:08:29 -05:00
Justin Ruggles
53ed79a260 vqa: use 1/sample_rate as the audio stream time base 2012-01-24 14:08:29 -05:00
Justin Ruggles
e1ac69fa27 vqa: set stream start_time to 0.
The format has no coded timestamps and must use packet durations to generate
them.
2012-01-24 14:08:29 -05:00
Anton Khirnov
dc7ad30fa5 lavf: postpone removing av_close_input_file().
It has been deprecated only recently.
2012-01-24 18:04:19 +01:00
Michael Niedermayer
f1721fbc52 Merge remote-tracking branch 'tjoppen/mxf_fixes_20120124'
* tjoppen/mxf_fixes_20120124:
  mxfdec: Fix files > 2 GiB
  mxfdec: Handle small EditUnitByteCount

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-24 17:15:55 +01:00
Piotr Tomasik
62d2a75b02 Added clockwise rotate values to metadata for 90 and 270 degrees
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-24 17:01:10 +01:00
Paul B Mahol
6813450209 lavf: replace remaining use of deprecated get_strz()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-24 17:01:10 +01:00
Michael Niedermayer
fa94f8a848 buildsys: Fix shared lib build of ffserver.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-24 17:01:10 +01:00
Tomas Härdin
b720915be1 mxfdec: Fix files > 2 GiB
Accumulating into an int would cause overflow for files with essence
containers larger than 2 GiB.
2012-01-24 12:42:32 +01:00
Tomas Härdin
d8531a1c18 mxfdec: Handle small EditUnitByteCount
These are common with audio atoms. Without this the demuxer would read two
bytes at a time for a mono 16-bit file.
2012-01-24 11:36:39 +01:00
Michael Niedermayer
0bb57f8bf0 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Remove ffmpeg.
  aacenc: Simplify windowing
  aacenc: Move saved overlap samples to the beginning of the same buffer as incoming samples.
  aacenc: Deinterleave input samples before processing.
  aacenc: Store channel count in AACEncContext.
  aacenc: Move Q^3/4 calculation to it's own table
  aacenc: Request normalized float samples instead of converting s16 samples to float.
  aacpsy: Replace an if with FFMAX in LAME windowing.
  aacenc: cosmetics, replace 'rd' with 'bits' in codebook_trellis_rate to make it more clear what is being calculated.
  aacpsy: cosmetics, change a FIXME to a NOTE about subshort comparisons
  aacenc: cosmetics: move init() and end() to the bottom of the file.
  aacenc: aac_encode_init() cleanup
  XWD encoder and decoder
  vc1: don't read the interpfrm and bfraction elements for interlaced frames
  mxfdec: fix memleak on mxf_read_close()
  westwood: split the AUD and VQA demuxers into separate files.

Conflicts:
	.gitignore
	Changelog
	Makefile
	configure
	doc/ffmpeg.texi
	ffmpeg.c
	libavcodec/Makefile
	libavcodec/aacenc.c
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/version.h
	libavformat/Makefile
	libavformat/img2.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-24 02:41:53 +01:00
Michael Niedermayer
f58d670002 movenc: Decrease default chunk merge limit to 1mb.
This reduces the delay when opening the video with quicktime.

Idea-by: Maksym Veremeyenko <verem@m1stereo.tv>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-23 23:41:32 +01:00
Maksym Veremeyenko
2aadff2e44 limit chunk size to 1GB
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-23 20:49:29 +01:00
Paul B Mahol
f7a9b1deee cafdec: fix regression introduced in c7579ad8e8
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-23 20:38:46 +01:00
Michael Niedermayer
14d94a1952 avidec: Fix use of stream_index before validation of its range.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-23 19:47:49 +01:00
Paul B Mahol
27ed027bcd XWD encoder and decoder
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-01-23 19:04:35 +01:00
Janne Grunau
50a3f9a4bd mxfdec: fix memleak on mxf_read_close() 2012-01-23 17:29:58 +01:00
Paul B Mahol
c7579ad8e8 cafdec: replace deprecated get_strz() 2012-01-23 17:18:44 +01:00
Paul B Mahol
a6ef7b3a77 cafenc: replace deprecated av_dbl2int() 2012-01-23 17:18:13 +01:00
Justin Ruggles
e924a4ba71 westwood: split the AUD and VQA demuxers into separate files.
They have no code in common.
2012-01-23 10:34:48 -05:00
Michael Niedermayer
b9db728a1f libavformat/libavformat.v: fix application name in comment
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-23 01:46:57 +01:00
Michael Niedermayer
feb997577b Merge remote-tracking branch 'qatar/master'
* qatar/master: (25 commits)
  riff: fix invalid av_freep() calls on EOF in ff_read_riff_info
  pam: Fix a typo that broke writing and reading PAM files.
  mxfdec: fix memleak on av_realloc failures
  mxfdec: Do not parse slices or DeltaEntryArrays.
  mxfdec: hybrid demuxing/seeking solution
  mxfdec: Add Avid's essence element key.
  mfxdec: Separate mxf_essence_container_uls for audio and video.
  mxfdec: Compute packet offsets properly.
  mxfdec: Use MaterialPackage - Track - TrackID instead of the system_item hack.
  mxfdec: use av_dlog() for 'no corresponding source package found'
  mxfdec: Make mxf->partitions sorted by offset.
  mxfdec: parse ThisPartition
  mxfdec: Speed up metadata and index parsing.
  mxfdec: Make sure DataDefinition is consistent between material track and source track.
  mxfdec: add EssenceContainer UL found in 0001GL00.MXF.A1.mxf_opatom.mxf
  mxfdec: Add hack that adjusts the n_delta calculation when system items are present.
  mxfdec: Parse IndexTableSegments and convert them into AVIndexEntry arrays.
  mxfdec: Move FooterPartition to MXFContext and make sure it is never zero.
  mxfdec: check return value of avio_seek
  mxfdec: skip to end of structural sets
  ...

Conflicts:
	configure
	libavcodec/pnm.c
	libavformat/mxfdec.c
	libavformat/riff.c
	libavformat/rtsp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-23 01:05:20 +01:00
Michael Niedermayer
89ddff92a3 Revert "movenc: simplify handling of pcm vs. adpcm vs. other compressed codecs"
This reverts commit 8e8c51318c.

Fixes Ticket873

Conflicts:

	tests/ref/acodec/pcm_s16be
	tests/ref/acodec/pcm_s24be
	tests/ref/acodec/pcm_s32be
	tests/ref/acodec/pcm_s8
	tests/ref/lavf/mov

Approved-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-22 23:40:24 +01:00
Janne Grunau
15cea3695d riff: fix invalid av_freep() calls on EOF in ff_read_riff_info 2012-01-22 19:32:44 +01:00
Janne Grunau
20ea14d0f8 mxfdec: fix memleak on av_realloc failures 2012-01-22 14:47:11 +01:00
Tomas Härdin
fc85729458 mxfdec: Do not parse slices or DeltaEntryArrays.
The most recent demuxing/seeking code does not need them.
2012-01-22 14:40:54 +01:00
Janne Grunau
f028d4d1c3 mxfdec: hybrid demuxing/seeking solution
This uses the old demuxing code for OP1a and separate demuxing code for OPAtom.
Timestamp output is added to the old demuxing code.

The seeking code is made to seek to the start of the desired EditUnit only,
from which the normal demuxing code takes over (if OP1a). This means we
do not use delta entries or slices, only StreamOffsets. OPAtom seeking
basically works like before.

This also makes D-10 seeking behave the same way as OP1a and OPAtom. In other
words, we allow seeking before the start or past the end for D-10 too.

Based on several patches by Tomas Härdin <tomas.hardin@codemill.se> and
Reimar Döffinger <Reimar.Doeffinger@gmx.de>.

Changed av_calloc to av_mallocz, added overflow checks.
2012-01-22 14:40:53 +01:00
Tomas Härdin
1f5f8b2654 mxfdec: Add Avid's essence element key.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Carl Eugen Hoyos
44deb9f68d mfxdec: Separate mxf_essence_container_uls for audio and video.
It is a really bad idea to assign a video codec id
when we have set codec_type to audio and vice versa.

Prevents detection of mp2 in mxf as mpeg2video.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
3cb33fbe91 mxfdec: Compute packet offsets properly.
This replaces the old essence_offset code.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
f4187945a0 mxfdec: Use MaterialPackage - Track - TrackID instead of the system_item hack.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
21cc4b3327 mxfdec: use av_dlog() for 'no corresponding source package found'
This is not an error and expected behavior for OPAtom files.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
c77a5460b1 mxfdec: Make mxf->partitions sorted by offset.
This also zeroes new entries for good measure (used by future patches).

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
be78e3f6ec mxfdec: parse ThisPartition
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:53 +01:00
Tomas Härdin
775d3b4ab1 mxfdec: Speed up metadata and index parsing.
Specifically, this means parsing as before until we run into essence.
At that point we seek to the footer and parse until EOF. After that we start
seeking backward to the previous partition and parse that until we run into
essence or the next partition. This procedure is repeated until we encounter
the last partition we parsed in the forward direction.

The end result of all this is that large essence containers are not needlessly
parsed. This speeds up parsing large files a lot.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:52 +01:00
Tomas Härdin
0999151962 mxfdec: Make sure DataDefinition is consistent between material track and source track.
This fixes 0001GL.MXF.V1.mxf_opatom.mxf and 0001GL00.MXF.A1.mxf_opatom.mxf
getting two streams each due to both using the same SourcePackageID.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:52 +01:00
Tomas Härdin
0ac5e6a8c4 mxfdec: add EssenceContainer UL found in 0001GL00.MXF.A1.mxf_opatom.mxf
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:52 +01:00
Tomas Härdin
edb5085647 mxfdec: Add hack that adjusts the n_delta calculation when system items are present.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:52 +01:00
Janne Grunau
682b6db706 mxfdec: Parse IndexTableSegments and convert them into AVIndexEntry arrays.
Based on patch from Tomas Härdin <tomas.hardin@codemill.se>
and work by Georg Lippitsch <georg.lippitsch@gmx.at>

Changed av_calloc to av_mallocz and added overflow checks.
2012-01-22 14:40:52 +01:00
Tomas Härdin
83ab10f6e9 mxfdec: Move FooterPartition to MXFContext and make sure it is never zero.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:52 +01:00
Joakim Plate
3359246d9a mxfdec: check return value of avio_seek
Avoid modifying state if avio_seek fails.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:52 +01:00
Philip de Nier
0662eea6b0 mxfdec: skip to end of structural sets
This fixes reading of partition packs. The code stops reading after the
operational pattern and should skip the array of essence container
labels that follow.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2012-01-22 14:40:52 +01:00
Tomas Härdin
d32b3f40c7 mxfdec: parse MXF partitions 2012-01-22 14:40:51 +01:00
Michael Niedermayer
4f11bed7a1 avidec: fix "avidec.c:362: warning: st may be used uninitialized in this function"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-22 06:57:16 +01:00
Michael Niedermayer
887cd591a8 mpegpsmux: Fix integer overflow with huge VBV sizes.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-22 06:46:23 +01:00
Jean First
e8df18270a img2: add j2c file extension
Some applications use the j2c extension for jpeg2000 codestream files.

Signed-off-by: Jean First <jeanfirst@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-22 00:46:19 +01:00
Dmitry Volyntsev
58f0978581 rtsp: Use a random offset for trying to open UDP ports for RTP
This avoids (for all practical cases) the issue of reusing
the same UDP port as for an earlier connection. If the remote
doesn't know the previous session was closed, he might keep
on sending packets to that port. If we always start off trying
to open the same UDP port, we might get those packets intermixed
with the new ones.

This is occasionally an issue when testing RTSP stuff with
DSS, perhaps also with other servers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-22 01:10:03 +02:00
Martin Storsjö
dbb06b8c0d rtsp: Allow specifying the UDP port range via AVOptions
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-22 01:10:02 +02:00
Dmitry Volyntsev
bc495bad3d rtsp: Remove a leftover, currently pointless check
This check isn't relevant in the way the code currently works.

Also change a case of if (x == 0) into if (!x).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-22 01:10:00 +02:00
Michael Niedermayer
44d4fe9dad error_detection: put the old error detection constants back.
The old constants are more useful to the end user and have
orthogonal meanings to the new ones.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-21 23:46:36 +01:00
Michael Niedermayer
b5a69e79c5 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtpdec: Use our own SSRC in the SDES field when sending RRs
  Finalize changelog for 0.8 Release
  Prepare for 0.8 Release
  threads: change the default for threads back to 1
  threads: update slice_count and slice_offset from user context
  aviocat: Remove useless includes
  doc/APIChanges: fill in missing dates and hashes
  Revert "avserver: fix build after the next bump."
  mpegaudiodec: switch error detection check to AV_EF_BUFFER
  lavf: rename fer option and document resulting (f_)err_detect options
  lavc: rename err_filter option to err_detect and document it
  mpegvideo: fix invalid memory access for small video dimensions
  movenc: Reorder entries in the MOVIentry struct, for tigheter packing
  rtsp: Remove extern declarations for variables that don't exist
  aviocat: Flush the output before closing

Conflicts:
	Changelog
	RELEASE
	libavcodec/mpegaudiodec.c
	libavcodec/pthread.c
	libavformat/options.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-21 23:11:27 +01:00
Martin Storsjö
ad7beb2cac rtpdec: Use our own SSRC in the SDES field when sending RRs
The s->ssrc field is the sender's SSRC, we use ssrc + 1 to get
a collision free "unique" SSRC for ourselves in the RR part.
The SDES block in the RTCP packet should describe ourselves,
not the sender.

This was fixed for the RR part in 952139a322, but wasn't
fixed for the SDES part until now.

This could cause some Axis cameras to send RTCP BYE packets
to us due to the SSRC collision.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-21 22:18:12 +02:00
Carl Eugen Hoyos
9e53f62be1 Support decoding Avid DS Uncompressed (SUDS).
Fixes ticket #934
2012-01-21 17:58:26 +01:00
Dustin Brody
5124423ec3 lavf: rename fer option and document resulting (f_)err_detect options
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-01-21 08:33:05 +01:00
Michael Niedermayer
8f0768cc22 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Add a tool that uses avio to read and write, doing a plain copy of data
  ARM: fix build with FFT enabled and MDCT disabled
  lavf: force single-threaded decoding in avformat_find_stream_info
  avidec: migrate last of lavf from FF_ER_* to AV_EF_*
  avserver: fix build after the next bump.

Conflicts:
	libavformat/Makefile
	libavformat/avidec.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-21 01:33:31 +01:00