ffmpeg.git
5 years agoavutil/eval: change sqrt to hypot
Ganesh Ajjanagadde [Sat, 14 Nov 2015 17:04:53 +0000 (12:04 -0500)]
avutil/eval: change sqrt to hypot

This improves the mathematical behavior of hypotenuse computation.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoconfigure+libm.h: add hypot emulation
Ganesh Ajjanagadde [Sat, 14 Nov 2015 16:57:28 +0000 (11:57 -0500)]
configure+libm.h: add hypot emulation

It is known that the naive sqrt(x*x + y*y) approach for computing the
hypotenuse suffers from overflow and accuracy issues, see e.g
http://www.johndcook.com/blog/2010/06/02/whats-so-hard-about-finding-a-hypotenuse/.
This adds hypot support to FFmpeg, a C99 function.

On platforms without hypot, this patch does a reaonable workaround, that
although not as accurate as GNU libm, is readable and does not suffer
from the overflow issue. Improvements can be made separately.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavutil/libm: correct isnan, isinf compat hacks
Ganesh Ajjanagadde [Sun, 15 Nov 2015 00:52:57 +0000 (19:52 -0500)]
avutil/libm: correct isnan, isinf compat hacks

isnan and isinf are actually macros as per the standard. In particular,
the existing implementation has incorrect signature. Furthermore, this
results in undefined behavior for e.g double values outside float range
as per the standard.

This patch corrects the undefined behavior for all usage within FFmpeg.

Note that long double is not handled as it is not used in FFmpeg.
Furthermore, even if at some point long double gets used, it is likely
not needed to modify the macro in practice for usage in FFmpeg. See
below for analysis.

Getting long double to work strictly per the spec is significantly harder
since a long double may be an IEEE 128 bit quad (very rare), 80 bit
extended precision value (on GCC/Clang), or simply double (on recent Microsoft).
On the other hand, any potential future usage of long double is likely
for precision (when a platform offers extra precision) and not for range, since
the range anyway varies and is not as portable as IEEE 754 single/double
precision. In such cases, the implicit cast to a double is well defined
and isinf and isnan should work as intended.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/amr: replace #define by typedef
Ganesh Ajjanagadde [Mon, 16 Nov 2015 22:01:18 +0000 (17:01 -0500)]
avcodec/amr: replace #define by typedef

See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/atrac1: fix decoder: QMF delay compensation should be 39 samples
Daniil Cherednik [Fri, 13 Nov 2015 22:57:25 +0000 (01:57 +0300)]
avcodec/atrac1: fix decoder: QMF delay compensation should be 39 samples

This also adds a new fate test

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/utils: Fix indentation
Timothy Gu [Sat, 21 Nov 2015 05:29:34 +0000 (21:29 -0800)]
avformat/utils: Fix indentation

5 years agoaacsbr: don't call sbr_dequant twice without intermediate read_sbr_data
Andreas Cadhalpun [Fri, 20 Nov 2015 19:15:21 +0000 (20:15 +0100)]
aacsbr: don't call sbr_dequant twice without intermediate read_sbr_data

Doing that doesn't make sense, because the only purpose of sbr_dequant
is to process the data from read_sbr_data.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
5 years agoavformat/rsd: implement seeking
Paul B Mahol [Fri, 20 Nov 2015 19:51:22 +0000 (20:51 +0100)]
avformat/rsd: implement seeking

Signed-off-by: Paul B Mahol <onemda@gmail.com>
5 years agoavformat/ffmdec: Only return EAGAIN if a server is attached
Michael Niedermayer [Fri, 20 Nov 2015 02:10:11 +0000 (03:10 +0100)]
avformat/ffmdec: Only return EAGAIN if a server is attached

This should fix a infinite loop

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoffserver: Use AVOption API to access ffm demuxer instead of direct access depending...
Michael Niedermayer [Fri, 20 Nov 2015 02:09:28 +0000 (03:09 +0100)]
ffserver: Use AVOption API to access ffm demuxer instead of direct access depending on ABI

server_attached is newly added so the demuxer knows if there is an attached server
that can update the write index. This is needed to fix a infinite loop

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/ffmdec: Add cleaner API for ffserver to interface without depending on inter...
Michael Niedermayer [Fri, 20 Nov 2015 02:08:34 +0000 (03:08 +0100)]
avformat/ffmdec: Add cleaner API for ffserver to interface without depending on internal ABI

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoffmpeg: fix -copy_prior_start 0 with -copyts and input -ss
Rodger Combs [Mon, 2 Nov 2015 02:04:25 +0000 (20:04 -0600)]
ffmpeg: fix -copy_prior_start 0 with -copyts and input -ss

Also rearranged the relevant check to reduce code duplication

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/flvenc: Add aac_seq_header_detect and flvflags
Maksym Veremeyenko [Wed, 18 Nov 2015 21:44:08 +0000 (23:44 +0200)]
avformat/flvenc: Add aac_seq_header_detect and flvflags

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoffmpeg: preserve profile for audio stream copy
Maksym Veremeyenko [Wed, 18 Nov 2015 21:44:08 +0000 (23:44 +0200)]
ffmpeg: preserve profile for audio stream copy

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/assdec: allow ASS files starting with empty lines
Clément Bœsch [Fri, 20 Nov 2015 13:38:22 +0000 (14:38 +0100)]
avformat/assdec: allow ASS files starting with empty lines

See https://github.com/mpv-player/mpv/issues/2506

5 years agoavfilter/af_dynaudnorm: use M_PI
Ganesh Ajjanagadde [Wed, 11 Nov 2015 03:26:25 +0000 (22:26 -0500)]
avfilter/af_dynaudnorm: use M_PI

The ad-hoc pi constant has a ludicrous number of digits that offer no
value whatsoever. M_PI is more consistent and readable across the
codebase.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agotests/tiny_ssim: replace #define by typedef
Ganesh Ajjanagadde [Mon, 16 Nov 2015 22:07:58 +0000 (17:07 -0500)]
tests/tiny_ssim: replace #define by typedef

See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/faanidct: replace #define by typedef
Ganesh Ajjanagadde [Mon, 16 Nov 2015 22:10:43 +0000 (17:10 -0500)]
avcodec/faanidct: replace #define by typedef

See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/resample2: replace #define by typedef
Ganesh Ajjanagadde [Mon, 16 Nov 2015 22:14:22 +0000 (17:14 -0500)]
avcodec/resample2: replace #define by typedef

See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/lpc: replace #define by typedef
Ganesh Ajjanagadde [Mon, 16 Nov 2015 21:42:40 +0000 (16:42 -0500)]
avcodec/lpc: replace #define by typedef

See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/ac3: replace #define by typedef
Ganesh Ajjanagadde [Mon, 16 Nov 2015 21:54:48 +0000 (16:54 -0500)]
avcodec/ac3: replace #define by typedef

See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/h264, videotoolbox: do not return invalid frames on failure
wm4 [Fri, 20 Nov 2015 10:30:18 +0000 (11:30 +0100)]
avcodec/h264, videotoolbox: do not return invalid frames on failure

If videotoolbox_common_end_frame failed, then the AVFrame was returned
to the API user with the dummy buffer (in AVFrame.buf[0]) still set, and
the decode call indicating success.

These "half-set" AVFrames with dummy buffer are a videotoolbox specific
hack, because the decoder requires an allocated AVFrame for its internal
logic. Videotoolbox on the other hand allocates its frame itself
internally, and outputs it only on end_frame. At this point, the dummy
buffer is replaced with the real frame (unless decoding fails).

5 years agoavcodec/aacsbr_fixed: Replace a noise_facs_q check by an av_assert0
Michael Niedermayer [Fri, 20 Nov 2015 02:36:10 +0000 (03:36 +0100)]
avcodec/aacsbr_fixed: Replace a noise_facs_q check by an av_assert0

The replaced check should have become redundant

Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/sbr: fix copy and paste error
Michael Niedermayer [Fri, 20 Nov 2015 02:34:22 +0000 (03:34 +0100)]
avcodec/sbr: fix copy and paste error

Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agohqx: correct type and size check of info_offset
Andreas Cadhalpun [Sun, 15 Nov 2015 09:33:40 +0000 (10:33 +0100)]
hqx: correct type and size check of info_offset

It is used as size argument of ff_canopus_parse_info_tag, which uses it
as size argument to bytestream2_init, which only supports sizes up to
INT_MAX.
Changing it's type to unsigned simplifies the check.

Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
5 years agoavformat: add VPK demuxer
Paul B Mahol [Wed, 11 Nov 2015 09:49:30 +0000 (10:49 +0100)]
avformat: add VPK demuxer

Signed-off-by: Paul B Mahol <onemda@gmail.com>
5 years agoavformat/rsd: reindent after the last commit
James Almer [Thu, 19 Nov 2015 19:06:01 +0000 (16:06 -0300)]
avformat/rsd: reindent after the last commit

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavformat/rsd: GADP files are adpcm_thp_le
James Almer [Thu, 19 Nov 2015 19:00:16 +0000 (16:00 -0300)]
avformat/rsd: GADP files are adpcm_thp_le

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoMerge commit '1fc94724f1fd52944bb5ae571475c621da4b77a0'
Derek Buitenhuis [Thu, 19 Nov 2015 14:14:20 +0000 (14:14 +0000)]
Merge commit '1fc94724f1fd52944bb5ae571475c621da4b77a0'

* commit '1fc94724f1fd52944bb5ae571475c621da4b77a0':
  xtea: Clarify that the current API works in big endian mode

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoMerge commit '7b2211bfc4b0c4568180a8db2478023c42d9ff51'
Derek Buitenhuis [Thu, 19 Nov 2015 14:13:29 +0000 (14:13 +0000)]
Merge commit '7b2211bfc4b0c4568180a8db2478023c42d9ff51'

These are all no-op merges.

* commit '7b2211bfc4b0c4568180a8db2478023c42d9ff51':
  dds: add missing newline to log messages
  dds: validate compressed source buffer size
  dds: validate source buffer size before copying

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoMerge commit 'b5f963bfec1f452c37eee900c7b11f065d10dd60'
Derek Buitenhuis [Thu, 19 Nov 2015 14:11:45 +0000 (14:11 +0000)]
Merge commit 'b5f963bfec1f452c37eee900c7b11f065d10dd60'

* commit 'b5f963bfec1f452c37eee900c7b11f065d10dd60':
  mov: Drop dref when unable to parse

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoMerge commit '303f931938c618668f7f83c646a1850bef84641e'
Derek Buitenhuis [Thu, 19 Nov 2015 14:10:40 +0000 (14:10 +0000)]
Merge commit '303f931938c618668f7f83c646a1850bef84641e'

* commit '303f931938c618668f7f83c646a1850bef84641e':
  mov: Correctly store dref paths

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoMerge commit 'e25cac50e05d29a15d7a52c01c394ba913c97aee'
Derek Buitenhuis [Thu, 19 Nov 2015 14:08:42 +0000 (14:08 +0000)]
Merge commit 'e25cac50e05d29a15d7a52c01c394ba913c97aee'

* commit 'e25cac50e05d29a15d7a52c01c394ba913c97aee':
  lavc: Add missing mem.h header to libxvid and screenpresso

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoMerge commit '73b03249133d6631520089798087cbd963eed9ca'
Derek Buitenhuis [Thu, 19 Nov 2015 14:07:23 +0000 (14:07 +0000)]
Merge commit '73b03249133d6631520089798087cbd963eed9ca'

* commit '73b03249133d6631520089798087cbd963eed9ca':
  aiff: Support demuxing G.722 streams

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoavcodec/aacsbr: Replace a noise_facs_q check by an av_assert0
Michael Niedermayer [Thu, 19 Nov 2015 12:32:40 +0000 (13:32 +0100)]
avcodec/aacsbr: Replace a noise_facs_q check by an av_assert0

The replaced check should have become redundant

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/aacsbr_template: Check values read in read_sbr_noise()
Michael Niedermayer [Thu, 19 Nov 2015 12:00:27 +0000 (13:00 +0100)]
avcodec/aacsbr_template: Check values read in read_sbr_noise()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/aacsbr: Split pre dequantization noise factors table
Michael Niedermayer [Thu, 19 Nov 2015 11:03:22 +0000 (12:03 +0100)]
avcodec/aacsbr: Split pre dequantization noise factors table

This allows removing a special case for the fixed point decoder and will
make error checks simpler

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/pthread_slice: remove dummy_ret hack
Michael Niedermayer [Wed, 18 Nov 2015 23:28:05 +0000 (00:28 +0100)]
avcodec/pthread_slice: remove dummy_ret hack

This should avoid some tsan warnings

Found-by: Chris Cunningham <chcunningham@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agomxfdec: check edit_rate also for physical_track
Andreas Cadhalpun [Sun, 15 Nov 2015 16:46:08 +0000 (17:46 +0100)]
mxfdec: check edit_rate also for physical_track

Previously only the edit_rate of material_track was checked.
If it's negative, it causes assertion failures in av_rescale_rnd.

Reviewed-by: Tim Nicholson <nichot20-at-yahoo.com@ffmpeg.org>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
5 years agoavcodec/h264_slice: Clear top_borders on allocation
Michael Niedermayer [Wed, 18 Nov 2015 13:20:07 +0000 (14:20 +0100)]
avcodec/h264_slice: Clear top_borders on allocation

In case of bitstream errors the deblock filter and slices can access uninitialized
top_borders from previous slices which did not fill them as they stoped halfway due
to error or where entirely missing.

This also makes code using these tables deterministic in case of missing or damaged
slices

Found-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavutil/mem: Add av_fast_mallocz()
Michael Niedermayer [Wed, 18 Nov 2015 13:19:47 +0000 (14:19 +0100)]
avutil/mem: Add av_fast_mallocz()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoMerge commit '5f2c8315b3c1b28da0386fddb118ad6a0ed77a0c'
Derek Buitenhuis [Wed, 18 Nov 2015 16:46:57 +0000 (16:46 +0000)]
Merge commit '5f2c8315b3c1b28da0386fddb118ad6a0ed77a0c'

This is a no-op.

* commit '5f2c8315b3c1b28da0386fddb118ad6a0ed77a0c':
  thp: set duration for audio stream too

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoMerge commit '1d62ee38894afb696674db78cee8f8d89204a8fe'
Derek Buitenhuis [Wed, 18 Nov 2015 16:41:04 +0000 (16:41 +0000)]
Merge commit '1d62ee38894afb696674db78cee8f8d89204a8fe'

* commit '1d62ee38894afb696674db78cee8f8d89204a8fe':
  movenc: Add a unit test for signaling of the track start times

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoMerge commit 'bef3b1f59f036aba4a5fe599b2480f6bd9e6b280'
Derek Buitenhuis [Wed, 18 Nov 2015 16:40:16 +0000 (16:40 +0000)]
Merge commit 'bef3b1f59f036aba4a5fe599b2480f6bd9e6b280'

* commit 'bef3b1f59f036aba4a5fe599b2480f6bd9e6b280':
  movenc: Allow setting start_dts/start_cts before writing actual packets

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agomovenc-test: Pad the packet data start with 0s
Derek Buitenhuis [Tue, 17 Nov 2015 15:58:51 +0000 (15:58 +0000)]
movenc-test: Pad the packet data start with 0s

This way, it never starts with 0xFFF0, and never trips the
ADTS "Detection" code in movenc.c.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoavformat/genh: Fix tools/probetest failure
Michael Niedermayer [Tue, 17 Nov 2015 16:01:58 +0000 (17:01 +0100)]
avformat/genh: Fix tools/probetest failure

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/dashenc: Add framerate to dash manifest
Bryan Huh [Wed, 18 Nov 2015 09:13:14 +0000 (01:13 -0800)]
avformat/dashenc: Add framerate to dash manifest

DASH manifest should have framerate specified as an attribute in the
AdaptationSet element and Representation elements. Though ISO/IEC
23009-1:2014 doesn't seem to define frameRate as a required attribute,
it is at least optional, and DASH-IF IOP 3.0 seems to require it. See
section 3.2.4 of http://dashif.org/w/2015/04/DASH-IF-IOP-v3.0.pdf

In the event that avg_frame_rate is not set in the muxer, we ignore the
frameRate tag altogther.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat: add IVR demuxer
Paul B Mahol [Wed, 11 Nov 2015 21:04:57 +0000 (22:04 +0100)]
avformat: add IVR demuxer

Signed-off-by: Paul B Mahol <onemda@gmail.com>
5 years agoavcodec/faandct: use typedef instead of #define
Ganesh Ajjanagadde [Fri, 13 Nov 2015 16:17:08 +0000 (11:17 -0500)]
avcodec/faandct: use typedef instead of #define

See e.g https://stackoverflow.com/questions/1666353/are-typedef-and-define-the-same-in-c
for rationale.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavformat/rtpdec_mpa_robust: change assignment to inequality test in conditional
Ganesh Ajjanagadde [Tue, 27 Oct 2015 23:54:07 +0000 (19:54 -0400)]
avformat/rtpdec_mpa_robust: change assignment to inequality test in conditional

In the spirit of commit 8199908fdf9b3797cceaea9d1e2fc09d02ef7309, likely
typo originally.

Found by enabling -Wparentheses on clang 3.7 and running a manual audit.
To the best of my knowledge, no such instances remain.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavformat/matroskadec: Check subtitle stream before dereferencing
Michael Niedermayer [Tue, 17 Nov 2015 17:19:01 +0000 (18:19 +0100)]
avformat/matroskadec: Check subtitle stream before dereferencing

Unrecognized streams are not allocated
Fixes: flicker-1.color1.vp91447030769.08.webm

Found-by: Chris Cunningham <chcunningham@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoMerge commit '3eeb7edfc2a1157b7b0e0ce21ac2cd44d55d405b'
Derek Buitenhuis [Tue, 17 Nov 2015 14:56:55 +0000 (14:56 +0000)]
Merge commit '3eeb7edfc2a1157b7b0e0ce21ac2cd44d55d405b'

* commit '3eeb7edfc2a1157b7b0e0ce21ac2cd44d55d405b':
  movenc: Add a unit test for frag_discont with edit lists

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoMerge commit '09e431b9e3674804172e7b0a0f865b65ec09739a'
Derek Buitenhuis [Tue, 17 Nov 2015 14:55:22 +0000 (14:55 +0000)]
Merge commit '09e431b9e3674804172e7b0a0f865b65ec09739a'

* commit '09e431b9e3674804172e7b0a0f865b65ec09739a':
  movenc: Assume streams starting at pts=0 for discontinuous fragments with editlists

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoavcodec/internal: Fix skiped typo
Michael Niedermayer [Mon, 16 Nov 2015 18:36:57 +0000 (19:36 +0100)]
avcodec/internal: Fix skiped typo

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agofate: update fate-source reference file
James Almer [Tue, 17 Nov 2015 00:12:01 +0000 (21:12 -0300)]
fate: update fate-source reference file

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavformat/movenc-test: fix copyright header
James Almer [Mon, 16 Nov 2015 23:54:30 +0000 (20:54 -0300)]
avformat/movenc-test: fix copyright header

Signed-off-by: James Almer <jamrial@gmail.com>
5 years agoavcodec/pngdec: Replace assert by request for sample for unsupported TRNS cases
Michael Niedermayer [Mon, 16 Nov 2015 17:34:44 +0000 (18:34 +0100)]
avcodec/pngdec: Replace assert by request for sample for unsupported TRNS cases

Fixes assertion failure
Fixes: 7f646252a30ee28b583aac1f82e7985e/signal_sigabrt_7ffff6ae7cc9_7353_62fc077bf2f454d39e188c69807193a6.png

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agofate: fix concat demuxer extended test portability
Marton Balint [Mon, 16 Nov 2015 12:19:40 +0000 (13:19 +0100)]
fate: fix concat demuxer extended test portability

Sed \r is not portable, it does not work on freebsd, hopefully tr -d will.

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agoMerge commit '59e8ec0aa8ab174701d01a3bfe96fedd0b7fcead'
Derek Buitenhuis [Mon, 16 Nov 2015 16:18:42 +0000 (16:18 +0000)]
Merge commit '59e8ec0aa8ab174701d01a3bfe96fedd0b7fcead'

All diferences in unit tests have been acounted for.

* commit '59e8ec0aa8ab174701d01a3bfe96fedd0b7fcead':
  movenc: Add an API unit test for fragmenting options/calls

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
5 years agoavformat/mov: remove redundant assignment
Ganesh Ajjanagadde [Mon, 16 Nov 2015 01:58:46 +0000 (20:58 -0500)]
avformat/mov: remove redundant assignment

This is possibly undefined behavior based on sequence point rules, but I
have not studied the spec at that level of detail.

Fixes: CID 1338321.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavformat/mov: fix memory leak
Ganesh Ajjanagadde [Mon, 16 Nov 2015 01:12:20 +0000 (20:12 -0500)]
avformat/mov: fix memory leak

Fixes: CID 1338328.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavformat/aviobuf: Simplify avio_read() and avio_seek()
Bryan Huh [Mon, 16 Nov 2015 02:02:11 +0000 (18:02 -0800)]
avformat/aviobuf: Simplify avio_read() and avio_seek()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/aviobuf: Improve readability of aviobuf (Add comments and docs)
Bryan Huh [Mon, 16 Nov 2015 02:02:11 +0000 (18:02 -0800)]
avformat/aviobuf: Improve readability of aviobuf (Add comments and docs)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agofate: fix concat demuxer extended tests on windows
Marton Balint [Mon, 16 Nov 2015 00:25:19 +0000 (01:25 +0100)]
fate: fix concat demuxer extended tests on windows

Line endings do matter to md5sum...

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agofate: fix concat demuxer tests on msys/cygwin by using relative paths
Marton Balint [Mon, 16 Nov 2015 00:25:18 +0000 (01:25 +0100)]
fate: fix concat demuxer tests on msys/cygwin by using relative paths

Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agoffmpeg: Simplify fps code related to delta0
Bryan Huh [Sun, 15 Nov 2015 02:26:30 +0000 (18:26 -0800)]
ffmpeg: Simplify fps code related to delta0

Small refactor of fps code for improved readability. In particular
the "cor" variable was unnecessary and misleading because it would
always be set to -delta0.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoffmpeg: Fixing typos and adding comments to fps code
Bryan Huh [Sun, 15 Nov 2015 02:23:20 +0000 (18:23 -0800)]
ffmpeg: Fixing typos and adding comments to fps code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agompegtsenc: add vc-1 support to MPEG-TS muxer (ticket 2141)
Hagen Schmidt [Thu, 12 Nov 2015 21:54:18 +0000 (22:54 +0100)]
mpegtsenc: add vc-1 support to MPEG-TS muxer (ticket 2141)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat/utils: Do not init parser if probing is unfinished
Michael Niedermayer [Sun, 15 Nov 2015 22:41:14 +0000 (23:41 +0100)]
avformat/utils: Do not init parser if probing is unfinished

Fixes assertion failure
Fixes: 136f8b8d47af7892306625e597dee655/signal_sigabrt_7ffff6ae7cc9_8941_ab11bea57c84796418f481f873dc31ba.dvr_ms

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/jpeg2000: Change coord to 32bit to support larger than 32k width or height
Michael Niedermayer [Sun, 15 Nov 2015 21:05:04 +0000 (22:05 +0100)]
avcodec/jpeg2000: Change coord to 32bit to support larger than 32k width or height

Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions
Michael Niedermayer [Sun, 15 Nov 2015 20:17:05 +0000 (21:17 +0100)]
avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range
Michael Niedermayer [Sun, 15 Nov 2015 20:12:50 +0000 (21:12 +0100)]
avcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range

Fixes potential integer overflows
Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi

This fix is choosen to be simple to backport, better solution
for master is planed

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/jpeg2000: Check comp coords to be within the supported size
Michael Niedermayer [Sun, 15 Nov 2015 19:49:17 +0000 (20:49 +0100)]
avcodec/jpeg2000: Check comp coords to be within the supported size

Fixes assertion failure
Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi

This fix is choosen to be simple to backport, better solution
for master is planed

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()
Michael Niedermayer [Sun, 15 Nov 2015 19:03:39 +0000 (20:03 +0100)]
avcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agofate: add concat demuxer tests
Marton Balint [Sat, 24 Oct 2015 13:39:18 +0000 (15:39 +0200)]
fate: add concat demuxer tests

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Marton Balint <cus@passwd.hu>
5 years agoavcodec/wmaprodec: Check for overread in decode_packet()
Michael Niedermayer [Sun, 15 Nov 2015 17:18:40 +0000 (18:18 +0100)]
avcodec/wmaprodec: Check for overread in decode_packet()

Fixes assertion failure
Fixes: 0256e92df2df7e933b43a2c70e4c8040/signal_sigabrt_7ffff6ae7cc9_1358_999ac18684788221490757582ce9af84.wma

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoswresample/resample: remove redundant L for floating literal
Ganesh Ajjanagadde [Sun, 15 Nov 2015 15:12:55 +0000 (10:12 -0500)]
swresample/resample: remove redundant L for floating literal

It is inherently double precision, and 1.0 is perfectly represented
anyway.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/faandct: use more accurate constants
Ganesh Ajjanagadde [Fri, 13 Nov 2015 16:19:33 +0000 (11:19 -0500)]
avcodec/faandct: use more accurate constants

This guarantees a "best effort precision".

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid...
Rainer Hochecker [Sun, 15 Nov 2015 12:58:50 +0000 (13:58 +0100)]
avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec

Fixes a mpegts file with hevc that fails estimating duration. Increasing number of
retries fixes the issue.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/smacker: Check that the data size is a multiple of a sample vector
Michael Niedermayer [Sun, 15 Nov 2015 13:52:08 +0000 (14:52 +0100)]
avcodec/smacker: Check that the data size is a multiple of a sample vector

Fixes out of array access
Fixes: ce19e41f0ef1e52a23edc488faecdb58/asan_heap-oob_2504e97_4202_ffa0df1baed14022b9bfd4f8ac23d0cb.smk

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agompegvideo: clear overread in clear_context
Andreas Cadhalpun [Sat, 14 Nov 2015 21:46:46 +0000 (22:46 +0100)]
mpegvideo: clear overread in clear_context

Otherwise the h263p decoder can try to copy overread bytes, even though
buffer is NULL.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
5 years agolavc/pngdec: set FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability
Matthieu Bouron [Mon, 2 Nov 2015 09:34:20 +0000 (10:34 +0100)]
lavc/pngdec: set FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability

5 years agolavc/mjpegdec: set FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability
Matthieu Bouron [Mon, 2 Nov 2015 09:32:51 +0000 (10:32 +0100)]
lavc/mjpegdec: set FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability

5 years agolavc/internal: add FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
Matthieu Bouron [Mon, 2 Nov 2015 09:27:58 +0000 (10:27 +0100)]
lavc/internal: add FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM

The decoder extracts and fills its parameters even if the frame is
skipped due to the skip_frame setting.

5 years agoavutil: Move av_rint64_clip_* to internal.h
Michael Niedermayer [Sun, 15 Nov 2015 01:35:02 +0000 (02:35 +0100)]
avutil: Move av_rint64_clip_* to internal.h

The function is renamed to ff_rint64_clip()

This should avoid build failures on VS2012
Feel free to changes this to a different solution

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/takdec: Skip last p2 sample (which is unused)
Michael Niedermayer [Sun, 15 Nov 2015 00:22:31 +0000 (01:22 +0100)]
avcodec/takdec: Skip last p2 sample (which is unused)

Fixes out of array read
Fixes: cb3f38b08b4541523974667c7d1eee9e/asan_heap-oob_2659e18_9838_021fd5cd635bf76cede6398cd9ecbcdd.tak

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/dxtory: Fix input size check in dxtory_decode_v1_410()
Michael Niedermayer [Sat, 14 Nov 2015 23:25:11 +0000 (00:25 +0100)]
avcodec/dxtory: Fix input size check in dxtory_decode_v1_410()

Fixes potential out of array read

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/dxtory: Fix input size check in dxtory_decode_v1_420()
Michael Niedermayer [Sat, 14 Nov 2015 23:25:11 +0000 (00:25 +0100)]
avcodec/dxtory: Fix input size check in dxtory_decode_v1_420()

Fixes out of array read
Fixes: c50c4aa6cefda71b19a31ea12302980c/asan_heap-oob_12be5fd_7011_33ebd015a74976215934add72b9c8352.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/error_resilience: avoid accessing previous or next frames tables beyond height
Michael Niedermayer [Sat, 14 Nov 2015 20:11:52 +0000 (21:11 +0100)]
avcodec/error_resilience: avoid accessing previous or next frames tables beyond height

The height of tables can be rounded up for MBAFF but this does not imply that is also true
for the previous frames

Fixes out of array reads
Fixes: c106b36fa36db8ff8f3ed0c82be7bea2/asan_heap-oob_32699f0_6321_467b9a1d7e03d7cfd310b7e65dc53bcc.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agodds: disable palette flag for compressed dds
Andreas Cadhalpun [Fri, 13 Nov 2015 20:48:27 +0000 (21:48 +0100)]
dds: disable palette flag for compressed dds

Having both is not valid and can cause a NULL pointer dereference of
frame->data[1] later.

Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
5 years agoavcodec/pgssubdec: Check dimensions for 0
Michael Niedermayer [Sat, 14 Nov 2015 17:06:37 +0000 (18:06 +0100)]
avcodec/pgssubdec: Check dimensions for 0

Fixes division by 0
Fixes: b293a6479bb4b5286cff24d356bfd955/asan_generic_225c3c9_7819_cc526b657450c6cdef1371b526499626.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/rscc: Check input size for raw mode
Michael Niedermayer [Sat, 14 Nov 2015 16:59:56 +0000 (17:59 +0100)]
avcodec/rscc: Check input size for raw mode

Fixes out of array read
Fixes: 7fcd09eadd046e326d8ea0af66f166c8/asan_heap-oob_4a52e5_2273_fa6078a10dd575df266fb1e0b4114cd5.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/simple_idct: use predefined M_SQRT2
Ganesh Ajjanagadde [Sat, 14 Nov 2015 15:55:10 +0000 (10:55 -0500)]
avcodec/simple_idct: use predefined M_SQRT2

M_SQRT2 is defined in math.h, or in avutil/mathematics.h for
compatibility hacks. This uses this value instead of a floating literal.

Fixed point values produced by C_FIX(), R_FIX() remain identical.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/mpegaudio: use predefined M_SQRT2
Ganesh Ajjanagadde [Sat, 14 Nov 2015 15:52:30 +0000 (10:52 -0500)]
avcodec/mpegaudio: use predefined M_SQRT2

M_SQRT2 is defined in math.h, or in avutil/mathematics.h for
compatibility hacks. This uses this value instead of an ad-hoc define.

Fixed point values produced by FIX() remain identical.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/mpegvideo: use predefined M_PI
Ganesh Ajjanagadde [Sat, 14 Nov 2015 15:49:45 +0000 (10:49 -0500)]
avcodec/mpegvideo: use predefined M_PI

M_PI is defined in math.h, or in avutil/mathematics.h for compatibility
hacks. This uses this value instead of an ad-hoc floating literal.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/ratecontrol: use predefined M_E
Ganesh Ajjanagadde [Wed, 11 Nov 2015 03:26:25 +0000 (22:26 -0500)]
avcodec/ratecontrol: use predefined M_E

M_E is defined in math.h, or in avutil/mathematics.h for compatibility
hacks. This uses this value instead of an ad-hoc define.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
5 years agoavcodec/dpx: Move need_align to act per line
Michael Niedermayer [Sat, 14 Nov 2015 13:29:02 +0000 (14:29 +0100)]
avcodec/dpx: Move need_align to act per line

Fixes out of array read
Fixes: 61cf123c081ee2bb774d307c75bdb99e/asan_heap-oob_1224f76_5546_bee833ffae73f752b489b9eeaac52db7.dpx

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavformat: implement SChannel SSP TLS protocol
Hendrik Leppkes [Sun, 4 Oct 2015 12:48:49 +0000 (14:48 +0200)]
avformat: implement SChannel SSP TLS protocol

This implementation does not support TLS listen sockets and loading
CA/Certs from files.

The Windows API does not support loading PEM certs, and would either
require a manual loader or instead be limited to loading Windows PFX
certificates

TLS listen sockets would have to be implemented quite separately, as many
of the APIs are different for server-mode (as opposed to client mode).

5 years agoavcodec/flashsv: Check size before updating it
Michael Niedermayer [Sat, 14 Nov 2015 12:34:02 +0000 (13:34 +0100)]
avcodec/flashsv: Check size before updating it

Fixes out of array read
Fixes: 3c857d4d90365731524716e6d051e43a/signal_sigsegv_7f4f59bcc29e_1386_20abd2c8e655cb9c75b24368e65fe3b1.flv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years agoavcodec/ffv1dec: Clear quant_table_count if its invalid
Michael Niedermayer [Sat, 14 Nov 2015 12:21:58 +0000 (13:21 +0100)]
avcodec/ffv1dec: Clear quant_table_count if its invalid

Fixes deallocation of corrupted pointer
Fixes: 343dfbe142a38b521ed069dc4ea7c03b/signal_sigsegv_421427_4074_ffb11959610278cd40dbc153464aa254.avi
No releases affected

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>