Commit Graph

12708 Commits

Author SHA1 Message Date
Anton Khirnov
d8b31be6ca Add the bumps and APIchanges entries for reference counted buffers changes. 2013-03-08 07:41:49 +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
Alexander Kojevnikov
eae0879d96 mp3dec: Fix VBR bit rate parsing
When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.

When parsing the stream, don't override the bit rate if it's already set,
otherwise calculate the mean bit rate from parsed frames. This way, the bit
rate will be set correctly both for CBR and VBR streams.

CC:libav-stable@libav.org

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-03-08 07:32:11 +01:00
Reimar Döffinger
efa7f42020 Use the avstring.h locale-independent character type functions
Make sure the behavior does not change with the locale.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-07 15:16:36 +02:00
Michael Niedermayer
cada996528 avformat: Fix apics with aac
Fixes Ticket2318

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-07 13:55:43 +01:00
Michael Niedermayer
a12a618aa9 hls: fix timebase
Fixes Ticket1733

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-07 13:42:12 +01:00
Stefano Sabatini
d95143ec82 lavf/segment: add support to ffconcat segment list 2013-03-07 01:44:59 +01:00
Michael Niedermayer
d929364814 asfdec: dont truncate type 2-5 values
Fixes use of uninitialized variables and possible out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-05 22:29:57 +01:00
Nicolas George
c31458c334 lavf/concat: compute duration if possible. 2013-03-05 16:44:51 +01:00
Nicolas George
3ab25e4574 Revert "lavf/concatdec: define "ffcat" and "ffconcat" extensions"
This reverts commit 6cc12353a8.

Conflicts:
	libavformat/version.h

Allowing to automatically select the concat demuxer raises
security concerns, as it allows a possibly hostile file to
access any file on the system. Guessing the format based on
the file name extension does not allow to enable the safe
mode designed to avoid it.
2013-03-05 14:10:10 +01:00
Alexander Kojevnikov
29d8cd265a mp3dec: Fix VBR bit rate parsing
When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag.

When parsing the stream, don't override the bit rate if it's already set,
otherwise calculate the mean bit rate from parsed frames. This way, the bit
rate will be set correctly both for CBR and VBR streams.

Signed-off-by: Alexander Kojevnikov <alexander@kojevnikov.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-05 13:06:01 +01:00
Michael Niedermayer
3dbc0ff9c3 iff: fix integer overflow
Fixes out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-05 01:39:50 +01:00
Michael Niedermayer
7992bdbeb4 update_stream_timings: check bitrate for being in range.
Fixes numerical overflow
Fixes Ticket2089

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-04 18:54:00 +01:00
Michael Niedermayer
faa0068a87 avformat: Make duration estimation from pts more robust
Ignore durations which differ significantly from the previous
Fixes Ticket2018

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-04 18:01:32 +01:00
Michael Niedermayer
9bb54bb685 nutdec: more specific return codes for decode_syncpoint()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-04 16:51:21 +01:00
Michael Niedermayer
7ccc0ed6a0 nutdec: print error on invalid/unsupported fourcc style
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-04 16:49:17 +01:00
Michael Niedermayer
144da7eeca Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
  buildsys: only include log2_tab per library for shared builds
  Add h264chroma dependency for cavs decoder to configure.
  Add h264qpel dependency for snow codec to configure.
  Add h264chroma dependency for vp5 and vp6 decoder to configure.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-04 14:45:52 +01:00
Michael Niedermayer
03148fd174 buildsys: only include log2_tab per library for shared builds
Fix linking failures with -all_load due to multiple log2_tabs

Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
2013-03-04 12:25:02 +01:00
Reimar Döffinger
88d55b827d Remove incorrect use of ctype.h functions.
As far as I can tell the code should not change behaviour
depending on locale in any of these places.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-03-03 21:44:10 +01:00
Michael Niedermayer
f2cb993139 avformat: gather aspect ratio from rv30/40 in find_stream_info
Fixes Ticket1550

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-03 18:41:16 +01:00
Michael Niedermayer
3fac99cd9d Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master:
  movenc: Do not flag secondary audio and subtitle tracks as enabled.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-03 14:05:09 +01:00
Michael Niedermayer
981cf0c300 movenc: Do not flag secondary audio and subtitle tracks as enabled.
Fixes ticket #468 and ticket #1174.

Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
2013-03-03 12:09:38 +01:00
Michael Niedermayer
fd464d4d01 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtpdec: Initialize some variables to silence compiler warnings

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-03 11:40:37 +01:00
Martin Storsjö
8fbab7a6c8 rtpdec: Initialize some variables to silence compiler warnings
The warnings are false positives, older gcc versions (such as 4.5)
think the variables can be used uninitialized while they in
practice can't, while newer (4.6) gets it right.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-02 21:23:52 +02:00
Carl Eugen Hoyos
6091a8d92d Avoid huge memory allocations from asf demuxer.
Fixes ticket #1888.
2013-03-02 18:37:55 +01:00
Michael Niedermayer
ec203cd69b Merge commit 'e671d3ad6cd7fe1d02e9b35b889a25d8c059fce9'
* commit 'e671d3ad6cd7fe1d02e9b35b889a25d8c059fce9':
  h264: do not copy ref count/ref2frm when updating per-frame context
  flvdec: Check the return value of a malloc

Conflicts:
	libavformat/flvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-02 11:41:31 +01:00
Michael Niedermayer
973dc110ba Merge commit 'c91c63b5380bf79655c09320774a022f84d76fd5'
* commit 'c91c63b5380bf79655c09320774a022f84d76fd5':
  flvdec: Don't read the VP6 header byte when setting codec type based on metadata

Conflicts:
	libavformat/flvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-02 11:27:58 +01:00
Martin Storsjö
c5a738ca4e flvdec: Check the return value of a malloc
The callers of this function can't report errors sanely. If this
one malloc fails, don't write the extradata byte, make sure we
try to malloc it the next time we're called instead, and make sure
we still consume the input data byte.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-02 00:39:37 +02:00
Martin Storsjö
c91c63b538 flvdec: Don't read the VP6 header byte when setting codec type based on metadata
This header byte is only present when actually reading a VP6 frame,
not when reading the codec type field in the metadata. This
potential bug has been present since 5b54a90c.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-02 00:39:36 +02:00
Nicolas George
d9fad53f4b lavf/avio: check for : in filenames for protocols.
If the first "special" character in a filename is a comma,
it can introduce protocol options, but only if there is a
colon at the end. Otherwise, it is just a filename with a
comma.

Fix trac ticket #2303.
2013-02-28 19:30:56 +01:00
Nicolas George
89f9f69e3f lavf: rescale duration for chained muxers.
Fix trac ticket #2300 because the duration of the segments
was computed using the timestamp of the last packet plus its
duration using the 1/90000 default time base instead of using
the chained muxer time base.
2013-02-28 19:20:25 +01:00
Michael Niedermayer
03678a32bc Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavf: Add a fate test for the noproxy pattern matching
  lavf: Handle the environment variable no_proxy more properly

Conflicts:
	libavformat/Makefile
	libavformat/internal.h
	libavformat/tls.c
	libavformat/utils.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-28 13:13:04 +01:00
Michael Niedermayer
1c6477f30f Revert "lavf/utils: add support for special characters encoding in URL"
This reverts commit 4a8fc1d83b.

The commit caused null pointer derefernces when using udp://
after i fixed that it caused ffmpeg to get stuck and remapped
arguments like ?ttl=255 -> ?ttl%3d255

I dont want to leave this broken thus temporary revert so we all
have some time to look at this without half the network protocols
being broken in the meantime
2013-02-28 01:29:12 +01:00
Senthilnathan M
4a8fc1d83b lavf/utils: add support for special characters encoding in URL
In particular, fix trac ticket #2031.

Signed-off-by: Senthilnathan M <senthilnathan.maadasamy@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2013-02-28 00:39:17 +01:00
Stefano Sabatini
6cc12353a8 lavf/concatdec: define "ffcat" and "ffconcat" extensions 2013-02-28 00:16:33 +01:00
Martin Storsjö
5c8696555a lavf: Add a fate test for the noproxy pattern matching
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-02-27 21:32:14 +02:00
Martin Storsjö
de9cd1b173 lavf: Handle the environment variable no_proxy more properly
The handling of the environment variable no_proxy, present since
one of the initial commits (de6d9b6404), is inconsistent with
how many other applications and libraries interpret this
variable. Its bare presence does not indicate that the use of
proxies should be skipped, but it is some sort of pattern for
hosts that does not need using a proxy (e.g. for a local network).

As investigated by Rudolf Polzer, different libraries handle this
in different ways, some supporting IP address masks, some supporting
arbitrary globbing using *, some just checking that the pattern matches
the end of the hostname without regard for whether it actually is
the right domain or a domain that ends in the same string.

This simple logic should be pretty similar to the logic used by
lynx and curl.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-02-27 21:32:13 +02:00
Michael Niedermayer
5d2f2c7643 oggdec: chained oggs have timestamp discontinuities
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-27 03:46:12 +01:00
Michael Niedermayer
e6f27346b7 pmpdec: make i unsigned, avoid undefined behavior of i++
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-25 18:36:21 +01:00
Michael Niedermayer
a960f3b918 pmpdec: fix integer overflow
Its unlikely this affects any valid files.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-25 18:36:21 +01:00
Reimar Döffinger
db6e2e848b hls: do not access pb->opaque for custom IO.
As the name indicates we can't just assume what the
"opaque" field contains.
This fixes a crash in third-party applications see e.g.:
http://bugzilla.mplayerhq.hu/show_bug.cgi?id=2126

This fixes also FFmpeg trac #2293, which is a different
third-party application.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-02-24 19:49:06 +01:00
Michael Niedermayer
663ebae79a Merge commit '56daf10e0313c5e36f43e773f457d2a99ff0df10'
* commit '56daf10e0313c5e36f43e773f457d2a99ff0df10':
  mov: use the format context for logging.
  flicvideo: avoid an infinite loop in byte run compression

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-24 13:15:59 +01:00
Nicolas George
ea2de3d096 lavf/concatdec: add the "duration" directive. 2013-02-24 13:12:46 +01:00
Nicolas George
b92c7a8f4b tools: add seek_print.
Useful for testing seek implementations.
2013-02-24 13:12:46 +01:00
Nicolas George
3d7f4f8726 lavf/avio: check that the protocol supports the open mode.
Fix trac ticket #2139.
2013-02-24 11:51:16 +01:00
Michael Niedermayer
066739f6bc pmpdec: check packet sizes
Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-24 00:13:54 +01:00
Michael Niedermayer
7276e9ea95 pmpdec: fix signedness
Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-24 00:13:54 +01:00
Michael Niedermayer
b0bc0eb978 pmpdec: read index before creating audio streams
This allows more complete checks

Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-24 00:13:54 +01:00
Reimar Döffinger
50a37f9202 pmpdec: check for EOF while reading index.
Otherwise even a tiny file can trigger a huge memory allocation.

Related to ticket #2298.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-02-24 00:01:56 +01:00
Michael Niedermayer
82d79289db avformat: Allocate duration_error separately
This significantly reduces the memory needed per AVStream when the
array is not needed.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-23 23:15:09 +01:00
Michael Niedermayer
285485ac5f matroskaenc: fix cue tracknum off by 1 error
Fixes out of array accesses

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-23 23:06:27 +01:00
Michael Niedermayer
da8ef5ac2f rtmpproto: increase APP_MAX_LENGTH
Fixes second part of Ticket2292

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-23 17:24:15 +01:00
Michael Niedermayer
02ac3398eb rtmpproto: Check APP_MAX_LENGTH
Fixes Ticket2292

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-23 17:18:22 +01:00
Anton Khirnov
56daf10e03 mov: use the format context for logging.
CC:libav-stable@libav.org
2013-02-23 13:05:16 +01:00
Paul B Mahol
c46400ddec cafenc: do not leak caf->pkt_sizes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-02-22 13:52:43 +00:00
Paul B Mahol
a72b41035c mxg: do not leak mxg->buffer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-02-22 13:37:35 +00:00
Andrea3000
8d8c59480e matroska: fix missing ,
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-21 22:24:26 +01:00
Carl Eugen Hoyos
d714576037 Use SMPTE standard notation when showing mxf Universal Labels. 2013-02-21 09:11:22 +01:00
Clément Bœsch
7346354b55 lavf/microdvd: fix muxing.
This was broken since 1f265f52.
2013-02-21 00:59:32 +01:00
Clément Bœsch
580e228557 lavf/swfdec: remove 8-bit audio FIXME.
Implemented since 624fb5f9.
2013-02-21 00:59:31 +01:00
Clément Bœsch
624fb5f965 lavf/swfdec: support 8-bits PCM audio. 2013-02-20 21:49:23 +01:00
Clément Bœsch
9a0076f50c lavf/swfdec: factorize the creation of a new stream.
This also makes the changes of a3949fe11 applicable in both cases.
2013-02-20 21:49:23 +01:00
Michael Niedermayer
2ccaab9709 mov: fix self referencing timecode tracks
Fixes read after free.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-20 15:46:33 +01:00
Stefano Sabatini
271f411267 lavf/matroskaenc: avoid assert failure in case of cuepoints with duplicated PTS
Avoid to write more than one cuepoint per track and PTS in
mkv_write_cues(). This avoids a later assertion failure on "(bytes >=
needed_bytes)" in put_ebml_num() called from end_ebml_master(), in case
there are several cuepoints per track with the same PTS.

This may happen with files containing packets with duplicated PTS in the
same track.
2013-02-20 12:01:21 +01:00
Michael Niedermayer
e39821a65e nutenc: only write an index if there are syncpoints
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-18 20:51:54 +01:00
Michael Niedermayer
6cd650dbd2 ff_gen_search: Fix finding the maximum timestamp in a really small file
Fixes Assertion failure

Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-18 20:37:17 +01:00
Michael Niedermayer
695a766bff ff_read_timestamp: check stream_index before using it as array index
Fixes out of array read

Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-18 20:37:17 +01:00
Carl Eugen Hoyos
8d0757e107 Revert "swfenc: use av_get_audio_frame_duration() instead of AVCodecContext.frame_size"
This reverts commit 620b88a302.

Fixes ticket #2272.

Conflicts:
	libavformat/swfenc.c
2013-02-17 19:56:09 +01:00
Michael Niedermayer
4a6fa7963b lavf: dont try to find fps for attached pictures
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-15 03:19:18 +01:00
rogerdpack
12c71f648c dshow: Fix MSVC support, remove av_export, which was apparently unneeded anyway.
Also cleanup exported symbols

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-15 00:08:12 +01:00
Vignesh Venkatasubramanian
003be0a9c3 Removing network.h from matroskadec.c
Removing accidentally added include file.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 23:59:41 +01:00
Clément Bœsch
d5ce725cb3 Fix a few "its" vs "it's" typo. 2013-02-14 23:45:48 +01:00
Vignesh Venkatasubramanian
ce6a8e5947 Adding AlphaMode element to Matroska Parser
Adding support for parsing AlphaMode element in the Track header
and export that information as a metadata tag. This flag indicates
presence of alpha channel data in BlockAdditional element.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 21:34:47 +01:00
Michael Niedermayer
405cc0d905 movenc: hotfix, dont store fiel for h264 / mpeg4-asp / dnxhd
Other software does not store it in this case, and the information
is provided by the codec stream

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 17:48:08 +01:00
Carl Eugen Hoyos
7d0e3b197c Write the fiel atom to mov files independently of the used video coded.
The QuickTime specification does not contain any hint that the atom
must not be written in some cases and both the QuickTime and the
AVID decoders do not fail if the atom is present.

This change allows to signal (visually) interlaced streams with
a codec different from uncompressed video.

As a side-effect, this fixes ticket #2202
2013-02-14 15:08:37 +01:00
Michael Niedermayer
a08ebf04b1 matroskadec: simplify additional_id writing code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 00:55:25 +01:00
Vignesh Venkatasubramanian
30c5c45b12 Adding support for parsing BlockAdditional
Matroska specification lists support for BlockAdditional element
which is not supported by ffmpeg's matroska parser. This patch
adds grammar definitions for parsing that element (and few other
related elements) and then puts the data in AVPacket.side_data
with new AVPacketSideDataType AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-14 00:46:28 +01:00
Daniel Verkamp
5dd78ef34e WAV muxer: reindent 2013-02-13 17:36:55 +00:00
Nicolas George
b68dd8a161 lavf/concatdec: allow probing. 2013-02-13 14:58:50 +01:00
Nicolas George
db9dc5154d lavf/concatdec: add signature directive. 2013-02-13 14:58:50 +01:00
Nicolas George
6d680d20ad lavf/concatdec: add safe option. 2013-02-13 14:58:50 +01:00
Daniel Verkamp
1ecce266fa WAV muxer: add RF64 support 2013-02-12 14:50:27 +00:00
Carl Eugen Hoyos
182e342fdb Print mxf Universal Label if the user requested verbose logging.
Fixes ticket #2198
2013-02-11 13:11:16 +01:00
Stefano Sabatini
6b171f046c lavf/matroskaenc: provide more feedback in case of unsupported codec
Also return meaningful error code.
2013-02-10 21:00:56 +01:00
Michael Niedermayer
ea1d8465e6 Fix division by 0 due to audio frame size
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 18:15:33 +01:00
Michael Niedermayer
e88f392733 Merge commit '81726a4f0b8a43e19898e2a36fdde80583bafff0'
* commit '81726a4f0b8a43e19898e2a36fdde80583bafff0':
  FATE: add tests for additional flavors of asf cover art
  asfdec: do not assume every AVStream has a corresponding ASFStream

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 13:18:04 +01:00
Michael Niedermayer
9a714d871a Merge commit 'f5fac6f77752931347ab302563802dcaa49c2419'
* commit 'f5fac6f77752931347ab302563802dcaa49c2419':
  asfdec: support reading ID3v2 tags in ASF files

Conflicts:
	Changelog
	libavformat/asfdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 13:06:16 +01:00
Michael Niedermayer
30085bd43e Merge commit '84b721db366c0734fdfd23c8daaa7da7da21f761'
* commit '84b721db366c0734fdfd23c8daaa7da7da21f761':
  asfdec: also read Metadata Library Object

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 12:39:17 +01:00
Michael Niedermayer
3600049dae Merge commit '61f9ad2dfcb3f98b7ac5777d19d0e7b61d0be01e'
* commit '61f9ad2dfcb3f98b7ac5777d19d0e7b61d0be01e':
  asfdec: read the full Metadata Object, not just aspect ratio information

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 12:25:40 +01:00
Michael Niedermayer
0af4506e15 Merge commit '36fab50e90d15352e403e4cc210890810f2fb4e2'
* commit '36fab50e90d15352e403e4cc210890810f2fb4e2':
  asfdec: silence a warning
  mss4, ra288: Remove unused DSPContext local codec context members

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 12:14:14 +01:00
Carl Eugen Hoyos
f02f231e05 Do not write invalid matroska files.
Some real codecs are supported by the matroska specification
(and FFmpeg's matroska demuxer) but not the FFmpeg muxer.
2013-02-10 10:51:12 +01:00
Nicolas George
f43d09cd60 lavf: add tee pseudo-muxer. 2013-02-09 20:50:11 +01:00
Vladimir Pantelic
f5fac6f777 asfdec: support reading ID3v2 tags in ASF files
Yes, these files do exist

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Vladimir Pantelic
84b721db36 asfdec: also read Metadata Library Object
In some ASF files this objects holds cover art and other tags. Compared to
Metadata Object it can also hold GUIDs, but we ignore these for now.

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Vladimir Pantelic
61f9ad2dfc asfdec: read the full Metadata Object, not just aspect ratio information
Use the same get_tag()/get_value() as for the Extended Content Description
but handle the 16 bit vs 32 bit difference for type 2 (BOOL)

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Vladimir Pantelic
36fab50e90 asfdec: silence a warning
Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-02-09 18:57:21 +01:00
Anton Khirnov
1ef0e8a6bf asfdec: do not assume every AVStream has a corresponding ASFStream
This won't be true for ID3 attached picture.

Also stop allocating now useless dummy ASFStreams for ASF native
attached pictures.
2013-02-09 18:57:21 +01:00
Stefano Sabatini
765dbea9fe lavf/rawvideodec: fix/extend option descriptions 2013-02-09 14:57:10 +01:00
rogerdpack
aa715cdcf5 dshow: attempt to build shared as well as static
Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
2013-02-06 23:37:46 -07:00
Michael Niedermayer
47335126c0 ff_end_tag: assert that the start is aligned.
If its start is not aligned then aligning its end will
likely break many demuxers as they check the size and not
the position.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-08 12:51:52 +01:00
Paul B Mahol
810cd0dd9c riff: chunks must be at 2 byte boundary
Fixes #2244.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-02-08 10:40:41 +00:00
Michael Niedermayer
a8e748eee5 lavf: add seek2any to allow forcing seeking to non keyframes via AVOptions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-07 21:54:41 +01:00
Michael Niedermayer
7c00d853a6 matroskadec: support seek to non keyframes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-07 21:48:48 +01:00
Michael Niedermayer
199683c898 mov: remove unused function
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-07 11:54:46 +01:00
Stefano Sabatini
b3d2c6f8b9 lavf/segment: fix DTS inconsistencies with -reset_timestamps
The DTS needs to be resynched against the segment start PTS, or the
resulting DTS may result < PTS.

Reported-by: Owen Jones <riots6@gmail.com>

See thread:
Subject: [FFmpeg-user] pts/dts error using reset_timestamps while splitting a DVD
Date: Sat, 19 Jan 2013 08:58:27 +0000
2013-02-06 22:55:18 +01:00
Matthieu Bouron
59d40fc7e6 lavf/mov: skip version and flags attributes in mov_read_chan function
Fixes ticket #1764.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 22:39:40 +01:00
Michael Niedermayer
864fdfa062 framecrcenc: print all side data elements, not just the first
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 18:17:27 +01:00
Michael Niedermayer
b2c4431944 framecrcenc: Also print the size of side data elements
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 18:17:03 +01:00
Vignesh Venkatasubramanian
579c4add63 Fate test to print side_data crc if present
Modified the fate test crc generator to print the side_data's
crc if side_data is present.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 17:53:47 +01:00
Michael Niedermayer
fadf845973 Merge commit '48a4ffa722c0874b251de9d201babed52cef0bcb'
* commit '48a4ffa722c0874b251de9d201babed52cef0bcb':
  asf: K&R formatting cosmetics
  vc1dec: use codec_id instead of codec_tag for VC1IMAGE
  sh4: drop unused functions

Conflicts:
	libavformat/asf.c
	libavformat/asfdec.c
	libavformat/asfenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-06 14:25:28 +01:00
Diego Biurrun
48a4ffa722 asf: K&R formatting cosmetics 2013-02-06 09:48:51 +01:00
Stefano Sabatini
a12787960e lavf/segment: extend PTS debugging log with -reset_timestamps 2013-02-06 00:40:09 +01:00
Michael Niedermayer
f0eacbc760 dvenc: dont fail hard if the timecode is invalid
Instead just dont store the timecode
Fixes Ticket2187

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 22:57:35 +01:00
Michael Niedermayer
a8343bfb6a riff: fix infinite loop
Fixes Ticket2241

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-05 18:31:27 +01:00
Carl Eugen Hoyos
90020d7f4b lavf/segment: use correct spelling and value for EXT-X-ALLOW-CACHE tag
Replace wrong "EXT-X-ALLOWCACHE" with "EXT-X-ALLOW-CACHE", and value 1/0
with YES/NO, as per spec.

Fix trac ticket #2228.

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2013-02-03 11:17:35 +01:00
Carl Eugen Hoyos
a60530e3ee Require at least three frames to autodetect loas. 2013-02-02 22:36:25 +01:00
Carl Eugen Hoyos
b45a3e167f Map the interlaced flag of yuv4mpeg streams to AVCodecContext->field_order.
Fixes a part of ticket #2190.
2013-02-02 12:32:04 +01:00
Carl Eugen Hoyos
985e93a865 Do not fail for mixed interlaced / non-interlaced YUV4MPEG streams. 2013-02-02 00:01:48 +01:00
Carl Eugen Hoyos
6a50e8a190 Do not change codec in flv streams if the user has forced a codec.
Fixes ticket #2218.
2013-02-01 23:27:15 +01:00
Michael Niedermayer
911e270688 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Use proper "" quotes for local header #includes
  ppc: fmtconvert: Drop two unused variables.
  bink demuxer: set framerate.

Conflicts:
	libavcodec/kbdwin.c
	libavcodec/ppc/fmtconvert_altivec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-01 14:34:18 +01:00
Diego Biurrun
6c1a7d07eb Use proper "" quotes for local header #includes 2013-02-01 12:51:15 +01:00
Anton Khirnov
9ec8971060 bink demuxer: set framerate. 2013-02-01 12:42:17 +01:00
Anton Khirnov
1730ca2eca bink demuxer: check malloc return value 2013-02-01 12:41:38 +01:00
Allan Kristensen
4789c25d83 matroska: fixed missing S_DVBSUB subtitles 2013-02-01 01:49:04 +01:00
Michael Niedermayer
01d012ba3d Merge commit '29f1fa74225e9fdbab6d590857edbecb51cf74da'
* commit '29f1fa74225e9fdbab6d590857edbecb51cf74da':
  configure: Move newlib libc check before mingw libc check
  avisynth: Change demuxer name to avoid conflicts with AVS

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-31 19:52:58 +01:00
Diego Biurrun
0f5b0b4178 avisynth: Change demuxer name to avoid conflicts with AVS 2013-01-31 11:19:22 +01:00
Michael Niedermayer
fe6767f849 asfdec: fix integer overflow in packet_replic_size check
Fixes assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-31 03:37:43 +01:00
Paul B Mahol
0dcfccaa69 auenc: strict check for supported codec
Also check number of streams and give error message why muxing failed.
This prevents muxing unsupported codec with known and supported tag.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-30 22:17:52 +00:00
Paul B Mahol
10e4905dd9 auenc: remove put_au_header() and merge its code into au_write_header
Such level of abstraction is pointless.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-30 22:17:52 +00:00
Michael Niedermayer
033f1644b5 fixup_vorbis_headers: add missing malloc failure check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-30 20:04:14 +01:00
Paweł Hajdan, Jr
0451ff295a oggparsevorbis: use av_realloc consistently
Memory passed to av_realloc cannot be allocated using memalign.

From realloc(3):

The realloc() function changes the size of the memory block pointed to
by ptr to size bytes. (...) Unless ptr is NULL, it must have been returned
by an earlier call to malloc(), calloc() or realloc().

The issue has been found by debugallocation, a part of google-perftools:
http://code.google.com/p/gperftools/ .

Signed-off-by: Paweł Hajdan, Jr <phajdan@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-30 19:54:35 +01:00
Michael Niedermayer
afb4bc3d29 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  movenc: Simplify code by using avio_wb24
  bfin: unbreak compilation

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-30 14:49:49 +01:00
Martin Storsjö
61d36761ef movenc: Simplify code by using avio_wb24
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-30 13:45:45 +02:00
Carl Eugen Hoyos
91f359292a Correctly mark non-default streams when muxing matroska.
Fixes ticket #1815.

Reviewed-by: Hendrik Leppkes
2013-01-30 10:28:53 +01:00
Michael Niedermayer
99b1b2b1c6 r3d: check that sampling rate is non negative.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-29 17:13:45 +01:00
Michael Niedermayer
df92ac1852 r3d: fix division by 0 with 0 sample rate
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-29 16:57:50 +01:00
Michael Niedermayer
036b9ee1c9 oggenc: fix "oggstream may be used uninitialized in this function" warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-29 15:57:42 +01:00
Michael Niedermayer
3c8085dc42 Merge commit 'e6b1c3bbe7082c71ea8ee8ac83698c156c9e4838'
* commit 'e6b1c3bbe7082c71ea8ee8ac83698c156c9e4838':
  pthread: make ff_thread_release_buffer idempotent.
  mvi: set framerate

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-29 14:19:56 +01:00
Anton Khirnov
729b37149c mvi: set framerate
This container does not store timestamps and thus supports CFR only.
2013-01-29 07:31:55 +01:00
Carl Eugen Hoyos
d88d0b6db6 Write forced track flag to matroska files.
Based on a patch by Daniel Pielmeier, daniel pielmeier gmail
Fixes a part of ticket #1815.
2013-01-27 23:24:52 +01:00
Clément Bœsch
f2b6aabd3d lavf/srtdec: do not try to queue empty subtitle chunks.
Regression since 3af3a30.
Fixes Ticket2167.
2013-01-27 20:26:35 +09:00
Michael Niedermayer
5de286ef88 mvdec: check var_read_string() return value
Prevent null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-27 02:15:02 +01:00
Michael Niedermayer
362271d72f mvdec: Check the frame counter against the correct limit.
fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-27 02:11:19 +01:00
Paul B Mahol
d1d159d31e lavf/gifdec: cosmetics: remove extra whitespace
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-26 09:28:57 +00:00
Paul B Mahol
254e11cc01 lavf/gifdec: fix typo
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-26 09:28:57 +00:00
Michael Niedermayer
13aca070ab gifdec: resync support
This allows decoding gifs that have junk at the begin
and also allows byte wise seeking

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-25 17:25:16 +01:00
Stefano Sabatini
1ec3324f00 lavf/img2enc: extend current options documentation 2013-01-25 00:04:23 +01:00
Stefano Sabatini
069d156454 lavf/img2dec: fix option help fields 2013-01-25 00:04:22 +01:00
Michael Niedermayer
55d66b2790 movenc: check that fps for tmcd is within encodable range.
The fps is stored as a 8 bit value thus 255 is the maximum encodable.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 18:59:49 +01:00
Michael Niedermayer
9362f31b55 movenc: Calculate fps for tmcd without intermediate step.
Fixes part of Ticket2045

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 18:57:12 +01:00
Michael Niedermayer
c071b00643 mpeg12demux: Fallback to startcode for stream type identification.
Fixes Ticket2147
Fixes SageTV support

Based-on patch by Andrew Gallatin
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 17:10:23 +01:00
Paul B Mahol
eb567a7999 eacdata: do not set sample_fmt
It is supposed to be set from lavc only.
Also this one differs from one set in decoder.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-24 15:02:44 +00:00
Paul B Mahol
7b007a7c1f flic: do not set sample_fmt
It is supposed to be set from lavc only.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-24 15:02:44 +00:00
Michael Niedermayer
b4581e9394 Merge commit '4a4a7e138c92901e04db46a6b05cc6948023e5f5'
* commit '4a4a7e138c92901e04db46a6b05cc6948023e5f5':
  rtpenc_chain: Use the original AVFormatContext for getting payload type
  rtp: Make sure the output format pointer is set

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 14:18:30 +01:00
Michael Niedermayer
40c27504a5 Merge commit '57ed8debb9b9cc565cc6e9f98c5b5cbb9f69097c'
* commit '57ed8debb9b9cc565cc6e9f98c5b5cbb9f69097c':
  wmv2: Propagate the wmv2 idct permutation type to the dsputils context
  rtp: Make sure priv_data is set before reading it

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 14:15:40 +01:00
Paul B Mahol
dd5689a3bd matroskadec: export codec bits_per_coded_sample
Fixes -codec copy with TTA from matroska to matroska.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-24 12:15:12 +00:00
Paul B Mahol
ee8d4a4142 matroskaenc: fix -codec copy with TTA
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-24 11:59:43 +00:00
Paul B Mahol
9ddf5631e3 matroskaenc: support TTA muxing
TTA in matroska does not store any private data.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-24 11:59:43 +00:00
Martin Storsjö
4a4a7e138c rtpenc_chain: Use the original AVFormatContext for getting payload type
In ff_rtp_get_payload_type, the AVFormatContext is used for checking
whether the payload_type or rtpflags options are set. In rtpenc_chain,
the rtpctx struct is a newly initialized struct where no options have
been set yet, so no options can be fetched from there.

All muxers that internally chain rtp muxers have the "rtpflags" field
that allows passing such options on (which is how this worked before
8034130e06), so this works just as intended.

This makes it possible to produce H263 in RFC2190 format with chained
RTP muxers.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-24 11:31:36 +02:00
Martin Storsjö
932117171f rtp: Make sure the output format pointer is set
Not sure if this actually happens, but we do the same check when
checking payload_type further above in the function, so it might
be needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-24 11:31:35 +02:00
Carl Eugen Hoyos
fc50175ba2 Refuse to mux tta into matroska, the output file is broken. 2013-01-24 10:23:00 +01:00
Michael Niedermayer
69fb605ad5 mpc8: check stream count before accessing stream 1.
Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-24 02:51:51 +01:00
Carl Eugen Hoyos
df39c3ce38 matroskaenc: add codec_tag lists back.
This reverts 312645e :
"Do not set codec_tag property for matroska muxers."

Also adds dummy codec_tag lists with codecs
supported in mkv but not in wav / avi.

Fixes ticket #2169.
2013-01-24 01:22:07 +01:00
Carl Eugen Hoyos
f8b6d4818e Only try to auto-detect LATM in mpegts if the LOAS demuxer was configured.
This allows to decode LATM-in-mpegts without the LOAS demuxer.
2013-01-24 01:21:13 +01:00
Martin Storsjö
e90820d4f8 rtp: Make sure priv_data is set before reading it
This fixes crashes with muxing H263 into RTSP.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-23 23:30:58 +02:00
Michael Niedermayer
665f2d432c hls: add missing checks for accessing avoption fields
Fixes null pointer exception and probably other things

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-23 22:22:53 +01:00
Micah Galizia
d4e5d8d4c2 lavf/hls: broker HTTP options
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2013-01-23 19:27:14 +01:00
Stefano Sabatini
e319725717 lavf/segment: exit immediately in case of invalid stream specifier
Avoid duplicated confusing error message, and propagate error code from
the failing avformat_match_stream_specifier() call.
2013-01-23 18:54:53 +01:00
Stefano Sabatini
bb539eb13a lavf/segment: avoid failure in case -flags +live and -segment_times/frames are specified
The conflict does not apply any longer, since the M3U8 segment target
duration is re-computed every time a new segment is added to the list.
2013-01-23 18:54:33 +01:00
Stefano Sabatini
f4e4e5b841 lavf/segment: drop now pointless segment_list_close() function 2013-01-23 18:32:01 +01:00
Stefano Sabatini
ca68acd7ac lavf/segment: mark #EXT-X-ENDLIST in M3U8 only at the end of stream
Should fix immediate playback termination.

In particular, should fix trac ticket #2172.
2013-01-23 18:32:01 +01:00
Xi Wang
cf29f49d8a rtpenc: fix overflow checking in avc_mp4_find_startcode()
The check `start + res < start' is broken since pointer overflow is
undefined behavior in C.  Many compilers such as gcc/clang optimize
away this check.

Use `res > end - start' instead.  Also change `res' to unsigned int
to avoid signed left-shift overflow.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-23 13:51:29 +02:00
Xi Wang
ecb918e5f0 rtmp: fix buffer overflows in ff_amf_tag_contents()
A negative `size' will bypass FFMIN().  In the subsequent memcpy() call,
`size' will be considered as a large positive value, leading to a buffer
overflow.

Change the type of `size' to unsigned int to avoid buffer overflow, and
simplify overflow checks accordingly. Also change a literal buffer
size to use sizeof, and limit the amount of data copied in another
memcpy call as well.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-23 13:51:28 +02:00
Xi Wang
3cff53369a rtmp: fix multiple broken overflow checks
Sanity checks like `data + size >= data_end || data + size < data' are
broken, because `data + size < data' assumes pointer overflow, which is
undefined behavior in C.  Many compilers such as gcc/clang optimize such
checks away.

Use `size < 0 || size >= data_end - data' instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-23 13:51:27 +02:00
Xi Wang
4e692374f7 rtmp: fix buffer overflows in ff_amf_tag_contents()
A negative `size' will bypass FFMIN().  In the subsequent memcpy() call,
`size' will be considered as a large positive value, leading to a buffer
overflow.

Change the type of `size' to unsigned int to avoid buffer overflow, and
simplify overflow checks accordingly.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-23 05:29:59 +01:00
Xi Wang
902cfe2f74 rtmp: fix multiple broken overflow checks
Sanity checks like `data + size >= data_end || data + size < data' are
broken, because `data + size < data' assumes pointer overflow, which is
undefined behavior in C.  Many compilers such as gcc/clang optimize such
checks away.

Use `size < 0 || size >= data_end - data' instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-23 05:28:38 +01:00
Xi Wang
2f014567cf rtpenc: fix overflow checking in avc_mp4_find_startcode()
The check `start + res < start' is broken since pointer overflow is
undefined behavior in C.  Many compilers such as gcc/clang optimize
away this check.

Use `res > end - start' instead.  Also change `res' to unsigned int
to avoid signed left-shift overflow.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-23 05:28:01 +01:00
Michael Niedermayer
b89815f519 mvdec: check channel count.
Fixes division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 23:06:49 +01:00
Michael Niedermayer
e6cc3c869b mvdec: minor simplification, remove av_inv_q()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 22:52:23 +01:00
Michael Niedermayer
4c9f35bb7c mvdec: use avpriv_set_pts_info() instead of directly setting tb.
Fixes division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 22:41:09 +01:00
Carl Eugen Hoyos
379d03b0c9 Fix compilation with --disable-everything --enable-demuxer=loas 2013-01-22 20:28:31 +01:00
Matthieu Bouron
c114414a57 lavf/aiffenc: ID3 tags support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 20:27:05 +01:00
Stefano Sabatini
30a40d4a55 lavf/segment: provide link to HTML M3U8 draft, also fix mentioned version in docs 2013-01-22 20:25:45 +01:00
Michael Niedermayer
9774251c45 rtpenc: do not use random values for seq when bitexact is requested.
Fixes fate

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 14:40:18 +01:00
Michael Niedermayer
73b59cc1ba Merge commit '4f56e773fe8a554b8c2662650aaf799c2ece2721'
* commit '4f56e773fe8a554b8c2662650aaf799c2ece2721':
  x86: ac3: Fix HAVE_MMXEXT condition to only refer to external assembly
  rtpenc: Start the sequence numbers from a random offset

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 14:27:48 +01:00
Michael Niedermayer
b4a7f4d018 Merge commit '570a4a0189946c2c983da41d37fdd67fa13266e7'
* commit '570a4a0189946c2c983da41d37fdd67fa13266e7':
  avidec: use sensible error codes instead of -1

Conflicts:
	libavformat/avidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 13:38:20 +01:00
Michael Niedermayer
0a84174f2d mov: prevent double free if the caller replaces the io context.
Fixes Ticket2148

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 05:15:47 +01:00
Martin Storsjö
ab587f39b2 rtpenc: Start the sequence numbers from a random offset
Expose the current sequence number via an AVOption - this can
be used both for setting the initial sequence number, or for
querying the current number.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-22 00:25:38 +02:00
Michael Niedermayer
05340be97b img2dec: support seeking in infinitely looped stream
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 19:53:41 +01:00
Stefano Sabatini
4630dfd1eb lavf/hlsenc: append last incomplete segment when closing the output
Also introduce missing check on PTS value in case of NOPTS value.
2013-01-21 19:21:21 +01:00
Michael Niedermayer
ed37a566c9 oggdec: remove unused variables
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 16:41:50 +01:00
Jindrich Makovicka
570a4a0189 avidec: use sensible error codes instead of -1
Use AVERROR_INVALIDDATA on invalid inputs, and AVERROR_EOF when no more
frames are available in an interleaved AVI.

Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-01-21 16:02:40 +01:00
Michael Niedermayer
2cf9ab6555 Merge commit '8a4f26206d7914eaf2903954ce97cb7686933382'
* commit '8a4f26206d7914eaf2903954ce97cb7686933382':
  dsputil: remove butterflies_float_interleave.
  srtp: Move a variable to a local scope
  srtp: Add tests for the crypto suite with 32/80 bit HMAC

Conflicts:
	libavcodec/x86/dsputil.asm
	libavcodec/x86/dsputil_mmx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 15:18:57 +01:00
Michael Niedermayer
248140f8a2 Merge commit '3ef6d22e1ba544ab37c73e8fc61382f13aac250f'
* commit '3ef6d22e1ba544ab37c73e8fc61382f13aac250f':
  srtp: cosmetics: Use fewer lines for the test vectors
  srtp: Don't require more input data than what actually is needed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 15:07:07 +01:00
Michael Niedermayer
bc639dbd9b Merge commit 'a2a991b2ddf951454ffceb7bcedc9db93e26c610'
* commit 'a2a991b2ddf951454ffceb7bcedc9db93e26c610':
  srtp: Improve the minimum encryption buffer size check
  srtp: Add support for a few DTLS-SRTP related crypto suites

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 15:00:45 +01:00
Michael Niedermayer
acc0c0190b Merge commit 'f53490cc0c809975f8238d5a9edbd26f83bd2f84'
* commit 'f53490cc0c809975f8238d5a9edbd26f83bd2f84':
  rtpdec/srtp: Handle CSRC fields being present
  rtpdec: Check the return value from av_new_packet
  ac3dec: fix non-optimal dithering of zero bit mantissas

Conflicts:
	libavcodec/ac3dec.c
	libavformat/rtpdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 14:55:48 +01:00
Michael Niedermayer
0a5da9cc14 Merge commit 'c6f1dc8e4cd967ae056698eafb891a08003c211c'
* commit 'c6f1dc8e4cd967ae056698eafb891a08003c211c':
  rtpdec: Move setting the parsing flags to the actual depacketizers
  rtpdec: Split handling of mpeg12 audio/video to a separate depacketizer

Conflicts:
	libavformat/rtpdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 14:02:01 +01:00
Michael Niedermayer
950482bf58 Merge commit '2326558d5277ec87ba6d607a01ec6acfc51c694c'
* commit '2326558d5277ec87ba6d607a01ec6acfc51c694c':
  rtpdec: Split mpegts parsing to a normal depacketizer
  rtpdec: Reorder payload handler registration alphabetically

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 13:52:42 +01:00
Michael Niedermayer
c3f3c22563 Merge commit 'a717f9904227d7979473bad40c50eb40af41d01d'
* commit 'a717f9904227d7979473bad40c50eb40af41d01d':
  mpegts: Share the cleanup code between the demuxer and lavf-internal parser functions
  rtpdec_mpeg4: Return one AAC AU per AVPacket
  ppc: Include string.h for memset

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 13:45:36 +01:00
Michael Niedermayer
c74d4658dc oggdec: #if 0 disabled code
Fixes CID968589
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-21 03:01:53 +01:00
Micah Galizia
c8ea5ccd5d fix memory leak on string reassign
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes CID968584 and CID968585
2013-01-21 02:50:02 +01:00
Martin Storsjö
c9311f3e46 srtp: Move a variable to a local scope
This simplifies the code slightly.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:17:00 +02:00
Martin Storsjö
3ef6d22e1b srtp: cosmetics: Use fewer lines for the test vectors
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:13:43 +02:00
Martin Storsjö
a2a991b2dd srtp: Improve the minimum encryption buffer size check
This clarifies where the limit number comes from, and only
requires exactly as much padding space as will be needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:13:43 +02:00
Martin Storsjö
ae01e8d295 srtp: Add tests for the crypto suite with 32/80 bit HMAC
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:13:43 +02:00
Martin Storsjö
b4bb1d493c srtp: Don't require more input data than what actually is needed
The theoretical minimum for a (not totally well formed) RTCP packet
is 8 bytes, so we shouldn't require 12 bytes as minimum input.

Also return AVERROR_INVALIDDATA instead of 0 if something that is
not a proper packet is given.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:13:43 +02:00
Martin Storsjö
e1d0b3d875 srtp: Add support for a few DTLS-SRTP related crypto suites
The main difference to the existing suites from RFC 4568 is
that the version with a 32 bit HMAC still uses 80 bit HMAC
for RTCP packets.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:13:35 +02:00
Martin Storsjö
f53490cc0c rtpdec/srtp: Handle CSRC fields being present
This is untested in practice, but follows the spec.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:10:47 +02:00
Martin Storsjö
a76bc3bc44 rtpdec: Check the return value from av_new_packet
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-21 00:08:19 +02:00
Xi Wang
64b7e7dcaf cafdec: fix overflow checking in read_header()
Several compilers such as clang/icc/pathscale will optimize the check
pos + size < pos (assuming size > 0) into false, since signed integer
overflow is undefined behavior in C.  This breaks overflow checking.
Use a safe precondition check instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-20 21:30:34 +01:00
Michael Niedermayer
3317414fc1 wtvdec: fix integer overflow
Fixes CID968583
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-20 20:59:30 +01:00
Michael Niedermayer
7cb27d216d oggdec: Support chained streams, support replacing streams in multistream files.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Conflicts:

	Changelog
2013-01-20 17:53:51 +01:00
Martin Storsjö
c6f1dc8e4c rtpdec: Move setting the parsing flags to the actual depacketizers
This gets rid of almost all the codec specific details from the
generic rtpdec code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:20:42 +02:00
Martin Storsjö
a9c847c1ba rtpdec: Split handling of mpeg12 audio/video to a separate depacketizer
This also adds checking of mallocs.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:20:22 +02:00
Martin Storsjö
2326558d52 rtpdec: Split mpegts parsing to a normal depacketizer
This gets rid of a number of special cases from the common rtpdec
code.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:17:17 +02:00
Martin Storsjö
d5bb8cc2dd rtpdec: Reorder payload handler registration alphabetically
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:16:04 +02:00
Martin Storsjö
a717f99042 mpegts: Share the cleanup code between the demuxer and lavf-internal parser functions
The lavf-internal parser functions are used when receiving
mpegts over RTP. This fixes memory leaks in this setup.

The normal mpegts demuxer close function was updated in ec7d0d2e in
2004 to fix leaks, but the parsing function used for RTP wasn't
updated and has been leaking ever since.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:14:17 +02:00
Martin Storsjö
21f5c24b80 rtpdec_mpeg4: Return one AAC AU per AVPacket
This makes the returned data valid to stream copy into other
containers as well, not only for decoding straight away.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-20 18:12:38 +02:00
Matthieu Bouron
b3b456b258 lavf/id3v2: seek back to previous offset if header size is not matched
Makes ff_id3v2_read reset stream position at the end of ID3 data if the
header size is not matched (caused by an EOF for example).

Current behaviour (without the patch):
    filesize = 400
    id3 data size = 399
    file offset after ff_id3v2_read is 400 instead of 399

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-20 04:39:56 +01:00
Matthieu Bouron
61625565e4 lavf/id3v2: cosmetics: reindent
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-19 14:37:44 +01:00
Stefano Sabatini
d00df260ca lavf/segment: do not auto-select a video stream with attached_pic disposition
In particular, fix trac ticket #2138.
2013-01-19 00:32:08 +01:00
Stefano Sabatini
bbce913edf lavf/segment: move reference stream selection code to a dedicated function 2013-01-19 00:32:01 +01:00
Stefano Sabatini
1de369a632 lavf/segment: remove now unused field list_max_segment_time 2013-01-19 00:23:36 +01:00
Stefano Sabatini
d4890c1068 lavf/segment: add support to segment list file entries sliding window listing
In particular, should fix trac ticket #1842.
2013-01-19 00:22:58 +01:00
Stefano Sabatini
6b7d9d5153 lavf/segment: add SegmentListEntry and use it
This patch is propedeutic to the incoming patch which adds
support to sliding window segment listing.
2013-01-19 00:14:03 +01:00
Stefano Sabatini
176b72a28c lavf/utils: provide feedback in case of invalid probe size
Log message in case the max_probe_size value in av_probe_input_buffer()
is smaller than the minimum accepted value.
2013-01-19 00:13:52 +01:00
Michael Niedermayer
17596198ca Merge commit '80ac87c13dc8c6c063e26a464c5c542357c0583f'
* commit '80ac87c13dc8c6c063e26a464c5c542357c0583f':
  lavc: support ZenoXVID custom tag
  libcdio: support recent cdio-paranoia
  float_dsp: Add #ifdef HAVE_INLINE_ASM around vector_fmul_window
  theora: Skip zero-sized headers

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-18 13:36:39 +01:00
Luca Barbato
80ac87c13d lavc: support ZenoXVID custom tag
Looks like this kind of samples are produced by certain Russian
equipment.
2013-01-17 21:41:18 +01:00
Carl Eugen Hoyos
a1a707f728 Add a new function av_codec_get_tag2().
av_codec_get_tag() may return 0 both in case a codec_tag was
found and if no codec_tag was found.
The new function does not have this ambiguity.
2013-01-17 20:44:33 +01:00
Carl Eugen Hoyos
ad406f7e40 Only skip MLP header in mpeg files if the codec actually is MLP.
Fixes PCM audio in Kansas Pheasant Hunt 2000 mpg file.
Reported-by: Mashiat Sarker Shakkhar
2013-01-17 17:19:08 +01:00
Michael Niedermayer
46730e7a0c mux/chunked interleaver: better align duration chunks.
This code causes the chunking to tend toward more optimal
alignment between streams.
The first chunks can still be less optimal aligned
2013-01-17 15:11:02 +01:00
Michael Niedermayer
69a96f9d4c mux: de-obfuscate chunked interleaver checks
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-17 15:08:50 +01:00
Michael Niedermayer
c57c1329a9 mux: simplify chunking interleaver code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-17 14:45:30 +01:00
Michael Niedermayer
2dc9bcad7d Merge remote-tracking branch 'qatar/master'
* qatar/master:
  idcin: fix memleaks in idcin_read_packet()

Conflicts:
	libavformat/idcin.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-17 13:44:37 +01:00
James Almer
b454c64e03 latmenc: Check for LOAS sync word
Write the packet unaltered if found.

Fixes ticket #1917

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-17 04:55:14 +01:00
Michael Niedermayer
1191db31c1 mux: fix chunked interleaver
The code did not account properly for packets that where added to
the end of the packet list. Also flags for such packets where not
set correctly leading to incorrect chunked interleaving.

Reported-by: bcoudurier
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-16 20:22:58 +01:00
Justin Ruggles
b805c725a3 idcin: fix memleaks in idcin_read_packet()
Fixes fate-id-cin-video failures when running FATE with valgrind.
2013-01-16 12:21:35 -05:00
Nicolas George
0942aa4637 lafv/matroska: add A_OPUS/EXPERIMENTAL codec name.
The exact packing of Opus inside Matroska is not finalized.
Use A_OPUS/EXPERIMENTAL as codec name, like mkvtoolnix.
The A_OPUS name stays to let ffmpeg open files it has produced
until now, but newly produced file use the EXPERIMENTAL version.
Once the spec is stabilized it will be possible to consider
options to ensure compatibility with these files.
2013-01-16 15:53:01 +01:00
Michael Niedermayer
cae11e4031 mux: fix chunked_duration rounding anomaly
a small value was rounded to 0 and then treated special as if
chunked_duration was 0. This led to a inconsistency that further led
to wrong interleaving

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-16 13:49:02 +01:00
Michael Niedermayer
5c7e9e16c9 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavc: Move vector_fmul_window to AVFloatDSPContext
  rtpdec_mpeg4: Check the remaining amount of data before reading

Conflicts:
	libavcodec/dsputil.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-16 12:38:41 +01:00
Michael Niedermayer
1459f34251 Merge commit '977d4a3b8a2dbc2fb5e747c7072485016c9cdfaa'
* commit '977d4a3b8a2dbc2fb5e747c7072485016c9cdfaa':
  rtpdec_mpeg4: Check the return value from malloc
  srtp: Mark a few variables as uninitialized

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-16 12:13:16 +01:00
Michael Niedermayer
9ea65c65f7 Merge commit '0eecafc948b74c247ebbc59f18f508db5d590d0b'
* commit '0eecafc948b74c247ebbc59f18f508db5d590d0b':
  configure: Make the new srtp protocol depend on the rtp protocol
  lavf: Add a fate test for the SRTP functions
  lavu: Add a fate test for the HMAC API

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-16 12:07:27 +01:00
Martin Storsjö
a7ba324413 rtpdec_mpeg4: Check the remaining amount of data before reading
This fixes possible buffer overreads.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-16 11:12:39 +02:00
Micah Galizia
0b80a12184 lavf/http: add HTTP protocol cookie support
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2013-01-15 22:26:30 +01:00
Martin Storsjö
977d4a3b8a rtpdec_mpeg4: Check the return value from malloc
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-15 23:18:33 +02:00
Martin Storsjö
42364fcbca srtp: Mark a few variables as uninitialized
This squelches false positive warnings (with gcc) about them being
used uninitalized.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-15 23:18:08 +02:00
Martin Storsjö
c2603aa25b lavf: Add a fate test for the SRTP functions
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-15 23:18:08 +02:00
Michael Niedermayer
c994bb2fb7 oggdec: Leave treatment of serial changes to the decoder.
Attempting to re-parse the headers at demuxer level is a
pandora box the way its done currently.

This allows full reconfiguration of vorbis streams

Fixes Ticket2117
Fixes Ticket2121

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-15 20:19:30 +01:00
Michael Niedermayer
c5cf58d4b9 oggdec: resync from the last page.
Previously we re synced from where we where which cam lead
to loosing pages.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-15 20:19:28 +01:00
Michael Niedermayer
918b411636 rtpdec: support CSRC
Untested, due to lack of rtp stream with CSRCs, but the code as
is does not work with multiple CSRCs

Reviewed-by: Luca Abeni <lucabe72@email.it>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-15 16:20:31 +01:00
Michael Niedermayer
77041e2474 Merge commit '094a7405e5d8463d7d167d893e04934ec1a84ecd'
* commit '094a7405e5d8463d7d167d893e04934ec1a84ecd':
  x86: ABSB: port to cpuflags
  sdp: Include SRTP crypto params if using the srtp protocol

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-15 16:12:24 +01:00
Michael Niedermayer
b52925d2cd Merge commit '2f3bada63e57345329c4f9b48e9b81b5cfc03d05'
* commit '2f3bada63e57345329c4f9b48e9b81b5cfc03d05':
  lavf: Add a protocol for SRTP encryption/decryption
  rtsp: Support decryption of SRTP signalled via RFC 4568 (SDES)

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-15 16:05:34 +01:00
Michael Niedermayer
e7e0186eeb Merge commit 'ab2ad8bd56882c0ea160b154e8b836eb71abc49d'
* commit 'ab2ad8bd56882c0ea160b154e8b836eb71abc49d':
  lavf: Add functions for SRTP decryption/encryption
  lavu: Add an API for calculating HMAC (RFC 2104)

Conflicts:
	doc/APIchanges
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-15 15:57:33 +01:00
Michael Niedermayer
353dbaa297 Merge commit '3f111804eb5c603a344706b84b7164cbf7b4e0df'
* commit '3f111804eb5c603a344706b84b7164cbf7b4e0df':
  libvpx: make vp8 and vp9 selectable
  libvpx: support vp9
  nut: support vp9 tag
  mkv: support vp9 tag
  rtpdec: Make variables that should wrap unsigned

Conflicts:
	configure
	libavcodec/Makefile
	libavcodec/allcodecs.c
	libavcodec/avcodec.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-15 14:57:57 +01:00
Michael Niedermayer
8686b6c68b Merge commit 'ba0c72a9ae1e2954e5dcf920f7b4e9a8f8a22f3e'
* commit 'ba0c72a9ae1e2954e5dcf920f7b4e9a8f8a22f3e':
  build: Remove stray Makefile entry for non-existent VCR1 encoder
  rtpdec: Handle more received packets than expected when sending RR

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-15 14:42:24 +01:00
Michael Niedermayer
eaf1f01169 Merge commit 'd0fe217e3990b003b3b3f2c2daaadfb2af590def'
* commit 'd0fe217e3990b003b3b3f2c2daaadfb2af590def':
  rtpdec: Simplify insertion into the linked list queue
  rtpdec: Remove a woefully misplaced comment

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-15 14:34:32 +01:00
Martin Storsjö
611bf39bde sdp: Include SRTP crypto params if using the srtp protocol
Also print port numbers for this protocol.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-15 11:55:29 +02:00
Martin Storsjö
2f3bada63e lavf: Add a protocol for SRTP encryption/decryption
This is mostly useful for encryption together with the RTP muxer,
but could also be set up as IO towards the peer with the SDP
demuxer with custom IO.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-15 11:55:10 +02:00
Martin Storsjö
424da30830 rtsp: Support decryption of SRTP signalled via RFC 4568 (SDES)
This only takes care of decrypting incoming packets; the outgoing
RTCP packets are not encrypted. This is enough for some use cases,
and signalling crypto keys for use with outgoing RTCP packets
doesn't fit as simply into the API. If the SDP demuxer is hooked
up with custom IO, the return packets can be encrypted e.g. via the
SRTP protocol.

If the SRTP keys aren't available within the SDP, the decryption
can be handled externally as well (when using custom IO).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-15 11:54:40 +02:00
Martin Storsjö
ab2ad8bd56 lavf: Add functions for SRTP decryption/encryption
This supports the AES_CM_128_HMAC_SHA1_80 and
AES_CM_128_HMAC_SHA1_32 cipher suites (from RFC 4568) at the
moment. The main missing features are replay protection (which can be
added later without changing the internal API), and the F8 and null
ciphers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-15 11:54:34 +02:00
Diego Biurrun
d8c772de53 nutdec: Always return a value from nut_read_timestamp()
The function is a callback that is called by ff_gen_search with
a constant stream index.

Avoid a false positive on older gcc version.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-15 02:15:09 +01:00
Giorgio Vazzana
39403c6c1b oggparsetheora: fix comment header parsing
Pass the correct header size to ff_vorbis_comment()

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-14 20:47:27 +02:00
Luca Barbato
23a610b9d6 nut: support vp9 tag 2013-01-14 19:20:47 +01:00
Tom Finegan
66aabd76a9 mkv: support vp9 tag 2013-01-14 19:20:47 +01:00
Martin Storsjö
d596f2b322 rtpdec: Make variables that should wrap unsigned
This makes the behaviour defined when they wrap around. The value
assigned to expected_prior was a uint32_t already.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-14 20:09:42 +02:00
Martin Storsjö
30b50f79ae rtpdec: Handle more received packets than expected when sending RR
Without this, we'd signal a huge loss rate (due to unsigned
wraparound) if we had received one packet more than expected (that
is, one seq number sent twice). The code has a check for lost_interval
<= 0, but that doesn't do what was intended as long as the variable is
unsigned.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-14 17:52:02 +02:00
Martin Storsjö
d0fe217e39 rtpdec: Simplify insertion into the linked list queue
By using a pointer-to-pointer, we avoid having to keep track
of the previous packet separately.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-14 17:51:48 +02:00
Martin Storsjö
62761934b0 rtpdec: Remove a woefully misplaced comment
The code below the comment does not at all relate to statistics,
and even if moved to the right place, the comment adds little
value.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-14 17:51:42 +02:00
Michael Niedermayer
6dc8505417 rtmpproto: Fix assignments in if()
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-14 13:13:00 +02:00
Michael Niedermayer
d641ee94b5 lavf: Fix assignments in if()
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-14 13:12:55 +02:00
Michael Niedermayer
a601eb9543 rtmpproto: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-14 05:05:42 +01:00
Michael Niedermayer
1ac5a8d7e3 lavf/mux: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-14 05:05:41 +01:00
Stefano Sabatini
98247e3368 lavf: clarify/extend documentation for AVFormatContext::analyzeduration
"analyzeduration" is not used to detect the input duration, but to
specify the max probe data duration. Fix option description and related
doc entry accordingly.
2013-01-13 15:09:09 +01:00
Stefano Sabatini
78e27c44c3 lavf/utils: clarify/extend messages in avformat_find_stream_info()
In particular, specify the unit of the shown values in case the max probe
size/duration is reached.
2013-01-13 15:09:09 +01:00
Michael Niedermayer
3bcf443f91 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtpdec: Send a valid "delay since SR" value in the RTCP RR packets

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-13 14:06:01 +01:00
Michael Niedermayer
6cd1dbe6df Merge commit 'e568db40258d549777ac1c16971678e18a18f5f5'
* commit 'e568db40258d549777ac1c16971678e18a18f5f5':
  rtpdec: Calculate and report packet reception jitter

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-13 14:00:12 +01:00
Michael Niedermayer
6d6eb7c12c Merge commit 'abae27ed3acd0a7c54f11760c5be2d2653c4edf8'
* commit 'abae27ed3acd0a7c54f11760c5be2d2653c4edf8':
  rtpdec: Fix the calculation of expected number of packets
  fate: vp3: Fix fate-vp3-coeff-level64 test dependencies

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-13 13:54:52 +01:00
Martin Storsjö
22c436c85e rtpdec: Send a valid "delay since SR" value in the RTCP RR packets
Previously, we always signalled a zero time since the last RTCP
SR, which is dubious.

The code also suggested that this would be the difference in
RTP NTP time units (32.32 fixed point), while it actually is
in in 1/65536 second units. (RFC 3550 section 6.4.1)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-12 19:55:49 +02:00
Martin Storsjö
e568db4025 rtpdec: Calculate and report packet reception jitter
This brings back some code that was added originally in 4a6cc061
but never was used, and was removed as unused in 4cc843fa. The
code is updated to actually work and is tested to return sane
values.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-12 19:53:53 +02:00
Martin Storsjö
abae27ed3a rtpdec: Fix the calculation of expected number of packets
The base_seq variable is set to first_seq - 1 (in
rtp_init_sequence), so no + 1 is needed here.

This avoids reporting 1 lost packet from the start.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-12 19:48:41 +02:00
Paul B Mahol
868ac91c8d frmdec: do not abuse ff_codec_get_id()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-12 14:39:13 +00:00
Michael Niedermayer
db1ba2213f lavf: use avpriv_find_pix_fmt instead of ff_
Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-12 14:09:08 +01:00
Michael Niedermayer
15daa8f9dd Merge commit 'f61272f0efd80da437570aad2c40e00f9d3f4fe6'
* commit 'f61272f0efd80da437570aad2c40e00f9d3f4fe6':
  ratecontrol: K&R cosmetic formatting
  rtpdec: Remove a useless todo comment

Conflicts:
	libavcodec/ratecontrol.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-12 13:32:13 +01:00
Michael Niedermayer
e730c3a2cb Merge commit '54cb096ee4558b3bfc28c2fcd6418ce82dc39fe1'
* commit '54cb096ee4558b3bfc28c2fcd6418ce82dc39fe1':
  rtsp: Remove an outdated comment
  rtsp: Remove references to weirdly named variables in other files

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-12 13:14:05 +01:00
Michael Niedermayer
dda2d29748 Merge commit 'c44784c9bb9d0ddf5d39d0dfa640816a57b8f457'
* commit 'c44784c9bb9d0ddf5d39d0dfa640816a57b8f457':
  rtp: Rename a static variable to normal naming conventions
  rtp: Cosmetic cleanup

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-12 13:00:50 +01:00
Stefano Sabatini
255ec768da lavf/http: fix/extend option descriptions
In particular, favor predicative form over nominal description of the set
parameter. This is more globally consistent.
2013-01-12 10:41:56 +01:00
Martin Storsjö
f6804c3e1b rtpdec: Remove a useless todo comment
The question can be answered: No, we do not know the initial sequence
number from the SDP. In certain cases, it can be known from the
RTP-Info response header in RTSP though. (In that case, we use it as
timestamp origin, but not for rtp receiver statistics.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-12 00:02:17 +02:00
Martin Storsjö
54cb096ee4 rtsp: Remove an outdated comment
It is unclear what the bug exactly was and if it ever was fixed,
and we don't even support decoding via faad any longer. The
comment has been present since d0deedcb in 2006.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-12 00:02:11 +02:00
Martin Storsjö
3900d53fb1 rtsp: Remove references to weirdly named variables in other files
One of them is renamed now, but mentioning it by name serves
no purpose here.  The other table mentioned ceased to exist
under that name in 4934884a1 in 2006.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-12 00:02:04 +02:00
Martin Storsjö
c44784c9bb rtp: Rename a static variable to normal naming conventions
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-12 00:01:51 +02:00
Martin Storsjö
58b5971881 rtp: Cosmetic cleanup
Remove leftover debug comments, fix brace placement and
add whitespace, remove unnecessary and weirdly placed braces.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-12 00:01:28 +02:00
Michael Niedermayer
e5e422bcc3 mxfdec: Fix integer overflow with many channels
Fixes division by zero

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-11 17:42:04 +01:00
Michael Niedermayer
2e230cf1b5 au: switch to ff_pcm_read_packet() again, after the merge
This fixes G722 durations

Suggested-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-11 15:18:58 +01:00
Michael Niedermayer
6fc0648932 Merge commit '7b8c5b263bc680eff5710bee5994de39d47fc15e'
* commit '7b8c5b263bc680eff5710bee5994de39d47fc15e':
  vc1dec: prevent a crash due missing pred_flag parameter
  matroska: Fix use after free

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-11 13:01:07 +01:00
Paul B Mahol
3ac85bebd5 lavf: remove nonexistent symbols
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-01-11 10:07:52 +00:00
Dale Curtis
ae3d416369 matroska: Fix use after free
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-11 00:12:08 +01:00
Michael Niedermayer
36055aa876 idcin: fix memleak
Found-by: valgrind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-10 17:26:03 +01:00
Michael Niedermayer
91da6b97c7 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtpdec_vp8: Don't trim too much data from broken frames
  rtpdec_vp8: Simplify code by using an existing helper function

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-10 13:07:25 +01:00
Michael Niedermayer
ac6e074fb7 Merge commit 'ed79093222ceb42f0c3a39095a69af0b32be5450'
* commit 'ed79093222ceb42f0c3a39095a69af0b32be5450':
  rtpdec: Add a terminating null byte at the end of the SDES/CNAME
  yuv4mpeg: do not use deprecated functions
  oggdec: fix faulty cleanup prototype
  idcin: return 0 from idcin_read_packet() on success.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-10 12:57:08 +01:00
Michael Niedermayer
56ca871fb3 Merge commit '5d0450461ff729be5f531d333d29754155e406c5'
* commit '5d0450461ff729be5f531d333d29754155e406c5':
  idcin: better error handling
  idcin: check for integer overflow when calling av_get_packet()

Conflicts:
	libavformat/idcin.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-10 12:52:02 +01:00