4 years agoavfilter/vf_libopencv: fix resource leak in read_shape_frame_filter
Steven Liu [Wed, 11 Jan 2017 01:59:55 +0000 (09:59 +0800)]
avfilter/vf_libopencv: fix resource leak in read_shape_frame_filter

CID: 1324298
add a label when error goto the label to release resource

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agolibavcodec/psd : add support for psd bitmap mode
Martin Vignali [Tue, 10 Jan 2017 23:18:29 +0000 (00:18 +0100)]
libavcodec/psd : add support for psd bitmap mode

Fixes ticket #6044

Based on patch by Carl Eugen Hoyos

4 years agolavc/psd: Interpret DUOTONE as GRAYSCALE.
Carl Eugen Hoyos [Tue, 10 Jan 2017 23:17:59 +0000 (00:17 +0100)]
lavc/psd: Interpret DUOTONE as GRAYSCALE.

This is what gimp, ImageMagick and FreeImage do and what the
Adobe Photoshop file format specification suggests.
Fixes a sample from ticket #6045.

Reviewed-by: Martin Vignali
4 years agoavformat/hlsenc: fix the bug when the largest segment duration pointer right value...
Steven Liu [Tue, 10 Jan 2017 20:38:34 +0000 (04:38 +0800)]
avformat/hlsenc: fix the bug when the largest segment duration pointer right value is 0

when the segments largest duration value is look like 4.000000, the
EXT-X-TARGETDURATION value should equ 4.
it's wrong when hlsenc use ceil, so fix it.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavformat/hlsenc: fix hls start and tail segment duration
Steven Liu [Tue, 10 Jan 2017 20:33:13 +0000 (04:33 +0800)]
avformat/hlsenc: fix hls start and tail segment duration

fix ticket: #6067

Tested-by: Pero
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavcodec/bsf: fix resource leak in av_bsf_list_parse_str
Steven Liu [Tue, 10 Jan 2017 20:09:47 +0000 (04:09 +0800)]
avcodec/bsf: fix resource leak in av_bsf_list_parse_str

cid: 1396268
when av_strdup(str) error, the lst need release

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavcodec/tiff: Perform multiply in tiff_unpack_lzma() as 64bit
Michael Niedermayer [Sun, 8 Jan 2017 15:37:56 +0000 (16:37 +0100)]
avcodec/tiff: Perform multiply in tiff_unpack_lzma() as 64bit

This should make no difference as the value should not be able to be that large
but its more correct this way

Fixes CID1348138

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agodoc/scaler: mention default scaling algorithm
Lou Logan [Fri, 23 Dec 2016 00:27:49 +0000 (15:27 -0900)]
doc/scaler: mention default scaling algorithm

Default is "bicubic".

Signed-off-by: Lou Logan <lou@lrcd.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/qdm2: make use of bytestream2
Paul B Mahol [Sun, 8 Jan 2017 18:59:06 +0000 (19:59 +0100)]
avcodec/qdm2: make use of bytestream2

Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agoavfilter/af_sofalizer: speed and clean up fast convolution a little
Paul B Mahol [Mon, 9 Jan 2017 17:15:03 +0000 (18:15 +0100)]
avfilter/af_sofalizer: speed and clean up fast convolution a little

Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agox86inc: Avoid using eax/rax for storing the stack pointer
Henrik Gramner [Tue, 20 Dec 2016 20:33:12 +0000 (21:33 +0100)]
x86inc: Avoid using eax/rax for storing the stack pointer

When allocating stack space with an alignment requirement that is larger
than the current stack alignment we need to store a copy of the original
stack pointer in order to be able to restore it later.

If we chose to use another register for this purpose we should not pick
eax/rax since it can be overwritten as a return value.

4 years agoavutil/tile: check clock_gettime at runtime for apple platforms
Wang Bin [Mon, 9 Jan 2017 03:52:06 +0000 (11:52 +0800)]
avutil/tile: check clock_gettime at runtime for apple platforms

clock_gettime is avalible since macOS 10.12 and iOS 10.0. Because of
weak linking, clock_gettime can be build without error with new
macOS/iOS sdk, but the symbol may not exist on the target system.
Explicitly checking the symbol is required.

Signed-off-by: Wang Bin <wbsecg1@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agolavc/vaapi_encode_h264: disable B frames in baseline profile
Jun Zhao [Sun, 8 Jan 2017 03:01:32 +0000 (11:01 +0800)]
lavc/vaapi_encode_h264: disable B frames in baseline profile

Disable B frames when using baseline/constrained baseline profile,
following H.264 spec Annex A.2.1.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Yi A Wang <yi.a.wang@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
4 years agoavfilter/af_dynaudnorm: fix hang with too short input
Paul B Mahol [Sun, 8 Jan 2017 19:41:36 +0000 (20:41 +0100)]
avfilter/af_dynaudnorm: fix hang with too short input

The only thing we can do at such point is return samples unchanged.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agoavcodec/bsf: Fix av_bsf_list_free()
Michael Niedermayer [Mon, 26 Dec 2016 22:45:53 +0000 (23:45 +0100)]
avcodec/bsf: Fix av_bsf_list_free()

Negate null check
Fixes CID1396248

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/omx: Do not pass negative value into av_malloc()
Michael Niedermayer [Thu, 29 Dec 2016 01:19:27 +0000 (02:19 +0100)]
avcodec/omx: Do not pass negative value into av_malloc()

Fixes CID1396849

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoffserver: local OOB write with custom program name
Tobias Stoeckmann [Fri, 6 Jan 2017 22:33:16 +0000 (23:33 +0100)]
ffserver: local OOB write with custom program name

When the command line for children is created, it is assumed that
my_program_name always ends with "ffserver", which doesn't have to
be true if ffserver is called through a symbolic link.

In such a case, it could be that not enough space for "ffmpeg" is
available at the end, leading to a buffer overflow.

One example would be:

$ ln -s /usr/bin/ffserver ~/f; ~/f

As this is only a local buffer overflow, i.e. is based on a weird
program call, this has NO security impact.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/riff: extend MagicYUV fourcc list
Paul B Mahol [Sat, 7 Jan 2017 11:29:32 +0000 (12:29 +0100)]
avformat/riff: extend MagicYUV fourcc list

Newer version of encoder can create such files.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agoavcodec/dca: add support for 20-bit XLL
foo86 [Sat, 7 Jan 2017 09:26:43 +0000 (12:26 +0300)]
avcodec/dca: add support for 20-bit XLL

Fixes ticket #6063.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/matroskaenc: Regression fix for invalid MKV headers
softworkz [Thu, 5 Jan 2017 00:24:03 +0000 (01:24 +0100)]
avformat/matroskaenc: Regression fix for invalid MKV headers

The following three commits created a regression by writing initially
invalid mkv headers:

650e17d88b63b5aca6e0a43483e89e64b0f7d2dd avformat/matroskaenc: write a
CRC32 element on Tags
3bcadf822711720ff0f8d14db71ae47cdf97e652 avformat/matroskaenc: write a
CRC32 element on Info
ee888cfbe777cd2916a3548c750e433ab8f8e6a5 avformat/matroskaenc: postpone
writing the Tracks master


- You can no longer playback a file that is still processed by ffmpeg,
e.g. VLC fails playback
- You can no longer stream a file to a client while if is still being
- Various diagnosing tools show header errors or incomplete headers
(e.g. ffprobe, mediainfo, mkvalidator)

Note: The symptoms do not apply to completed files or ffmpeg runs that
were interrupted with 'q'


The mentioned commits made changes in a way that some header elements
are only partially written in
mkv_write_header, leaving the header in an invalid state. Only in
mkv_write_trailer, these elements
are finished correctly, but that does only occur at the end of the


Before these commits were applied, mkv headers have always been valid,
even before completion of ffmpeg.
This has worked reliably over many versions of ffmpeg, to it was an
obvious regression.


This issue has been recorded as #5977 which is resolved by this patch


The patch adds a new function 'end_ebml_master_crc32_preliminary' that
preliminarily finishes the ebml
element without destroying the buffer. The buffer can be used to update
the ebml element later during
mkv_write_trailer. But most important: mkv_write_header finishes with a
valid mkv header again.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agolavfi/selectivecolor: add a link to algorithm explanations
Clément Bœsch [Sat, 7 Jan 2017 13:25:57 +0000 (14:25 +0100)]
lavfi/selectivecolor: add a link to algorithm explanations

4 years agolibavformat/avio: Add avio_get_dyn_buf function
softworkz [Thu, 5 Jan 2017 00:33:26 +0000 (01:33 +0100)]
libavformat/avio: Add avio_get_dyn_buf function

This commit adds the avio_get_dyn_buf function which allows accessing
content of a DynBuffer without destroying it.

This is required in matroskaenc for preliminary writing (correct) mkv

Context for this change is fixing regression bug #5977.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec: add QDMC decoder
Paul B Mahol [Mon, 26 Dec 2016 15:58:46 +0000 (16:58 +0100)]
avcodec: add QDMC decoder

Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agoavcodec/iff: add support for vertical word compression in ILBM
Paul B Mahol [Fri, 6 Jan 2017 20:44:14 +0000 (21:44 +0100)]
avcodec/iff: add support for vertical word compression in ILBM

Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agoomadec: fix overflows during bit rate calculation
Andreas Cadhalpun [Mon, 12 Dec 2016 23:35:12 +0000 (00:35 +0100)]
omadec: fix overflows during bit rate calculation

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agolibavcodec/exr: Fix blank output when data window != display window
Kevin Wheatley [Tue, 3 Jan 2017 16:31:16 +0000 (16:31 +0000)]
libavcodec/exr: Fix blank output when data window != display window

looks like there is a bug in commit
1a08758e7c4e14a9ea8d2fef6c33ad411b2d3c40 relating to the handling of
ptr in decode_frame after decode_block is called, before this commit
ptr would have been incremented for each line in the data window, now
after the commit it is left at the start of the first included line
rather than the line after the data window then the code sets the
remaining lines to 0 and thus the whole image is over written.

Fix by adjusting ptr to the correct line after decode_block returns

Signed-off-by: Kevin Wheatley <kevin.j.wheatley@gmail.com>
4 years agoavfilter/asrc_flite: Fix textbuf leak
Michael Niedermayer [Fri, 6 Jan 2017 14:46:56 +0000 (15:46 +0100)]
avfilter/asrc_flite: Fix textbuf leak

Fixes CID1244189

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_shuffleframes: allow also dropping frames
Paul B Mahol [Fri, 6 Jan 2017 11:27:46 +0000 (12:27 +0100)]
avfilter/vf_shuffleframes: allow also dropping frames

Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agoavformat/test/fifo_muxer: add check for FailingMuxerPacketData alloc
Steven Liu [Thu, 5 Jan 2017 22:35:32 +0000 (06:35 +0800)]
avformat/test/fifo_muxer: add check for FailingMuxerPacketData alloc

CID: 1396257

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoimdct15: replace the FFT with a faster PFA FFT algorithm
Rostislav Pehlivanov [Wed, 4 Jan 2017 09:23:24 +0000 (09:23 +0000)]
imdct15: replace the FFT with a faster PFA FFT algorithm

This commit replaces the current inefficient non-power-of-two FFT with a
much faster FFT based on the Prime Factor Algorithm.
Although it is already much faster than the old algorithm without SIMD,
the new algorithm makes use of the already very throughouly SIMD'd power
of two FFT, which improves performance even more across all platforms
which we have SIMD support for.

Most of the work was done by Peter Barfuss, who passed the code to me to
implement into the iMDCT and the current codebase. The code for a
5-point and 15-point FFT was derived from the previous implementation,
although it was optimized and simplified, which will make its future
SIMD easier. The 15-point FFT is currently using 6% of the current
overall decoder overhead.

The FFT can now easily be used as a forward transform by simply not
multiplying the 5-point FFT's imaginary component by -1 (which comes
from the fact that changing the complex exponential's angle by -1 also
changes the output by that) and by multiplying the "theta" angle of the
main exptab by -1. Hence the deliberately left multiplication by -1 at
the end.

FATE passes, and performance reports on other platforms/CPUs are

Performance comparisons:

101127 decicycles in speed,   32765 runs,      3 skips
iMDCT, Old:
211022 decicycles in speed,   32768 runs,      0 skips

Standalone FFT, 300000 transforms of size 960:
    PFA        Old FFT     kiss_fft    libfftw3f
    3.659695s, 15.726912s, 13.300789s, 1.182222s

Being only 3x slower than libfftw3f is a big achievement by itself.

There appears to be something capping the performance in the iMDCT side
of things, possibly during the pre-stage reindexing. However, it is
certainly fast enough for now.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
4 years agoimdct15: remove the AArch64 assembly
Rostislav Pehlivanov [Wed, 4 Jan 2017 01:16:11 +0000 (01:16 +0000)]
imdct15: remove the AArch64 assembly

Prep work for the next commit, which will add a new FFT algorithm
which makes the iMDCT over 3x faster than it is currently (standalone,
the FFT is with some framesizes over 10x faster).

The new FFT algorithm uses the already thouroughly SIMD'd power of two
FFT which already has SIMD for AArch64, so users of that platform will
still see an improvement.

The previous FFT+SIMD was barely 2.5x faster than the C versions on these

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
4 years agoavformat/hlsenc: fix Explicit null dereferenced in hlsenc
Steven Liu [Thu, 5 Jan 2017 22:29:12 +0000 (06:29 +0800)]
avformat/hlsenc: fix Explicit null dereferenced in hlsenc

CID: 1398228
Passing null pointer dirname to strlen, which dereferences it.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agodxva2: make ff_dxva2_get_surface() static and rename it
Steve Lhomme [Wed, 4 Jan 2017 13:36:41 +0000 (14:36 +0100)]
dxva2: make ff_dxva2_get_surface() static and rename it

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agodoc/muxers/hlsenc: typo hls_flag: discont_starts => discont_start
Bela Bodecs [Thu, 5 Jan 2017 12:21:13 +0000 (13:21 +0100)]
doc/muxers/hlsenc: typo hls_flag: discont_starts => discont_start

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agovformat/hlsenc: typo in default localtime pattern
Bela Bodecs [Thu, 5 Jan 2017 11:25:38 +0000 (19:25 +0800)]
vformat/hlsenc: typo in default localtime pattern

in get_default_pattern_localtime_fmt the default pattern contains
%Y%m%d%H%I%S but the original intention was %Y%m%d%H%M%S

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agolavc/Makefile: Clean up the amv encoder dependencies.
Carl Eugen Hoyos [Thu, 5 Jan 2017 11:17:54 +0000 (12:17 +0100)]
lavc/Makefile: Clean up the amv encoder dependencies.

4 years agoavcodec/bitstream: Document the values supported for *_size in ff_init_vlc_sparse()
Michael Niedermayer [Thu, 5 Jan 2017 10:57:17 +0000 (11:57 +0100)]
avcodec/bitstream: Document the values supported for *_size in ff_init_vlc_sparse()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/bitstream: assert that *_size in ff_init_vlc_sparse() is valid
Michael Niedermayer [Thu, 5 Jan 2017 10:56:00 +0000 (11:56 +0100)]
avcodec/bitstream: assert that *_size in ff_init_vlc_sparse() is valid

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoconfigure: Fix standalone compilation of the ljpeg encoder.
Carl Eugen Hoyos [Thu, 5 Jan 2017 10:44:04 +0000 (11:44 +0100)]
configure: Fix standalone compilation of the ljpeg encoder.

Also fixes compilation with --disable-error-resilience.
Fixes ticket #6060.

4 years agoavformat/hlsenc: fix memleak in hlsenc
Steven Liu [Thu, 5 Jan 2017 09:08:09 +0000 (17:08 +0800)]
avformat/hlsenc: fix memleak in hlsenc

fix CID: 1398364 Resource leak
refine the code of the new options

Reviewed-by: Bodecs Bela <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavformat/hlsenc: bugfix in duplicate filename detection
Bela Bodecs [Wed, 4 Jan 2017 23:39:00 +0000 (07:39 +0800)]
avformat/hlsenc: bugfix in duplicate filename detection

A wrong, unitialized variable is used for testing. This patch fixes this

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavfilter/avf_aphasemeter: fix memleaks
Paul B Mahol [Wed, 4 Jan 2017 12:15:19 +0000 (13:15 +0100)]
avfilter/avf_aphasemeter: fix memleaks

Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agolavf/matroska: Fix the codec_id for mkv tag A_MPEG/L1.
Carl Eugen Hoyos [Tue, 3 Jan 2017 02:43:34 +0000 (03:43 +0100)]
lavf/matroska: Fix the codec_id for mkv tag A_MPEG/L1.

When the mapping was originally added AV_CODEC_ID_MP1 did not exist.

4 years agoavformat/hlsenc: size and duration in segment filenames
Bela Bodecs [Tue, 3 Jan 2017 14:57:51 +0000 (22:57 +0800)]
avformat/hlsenc: size and duration in segment filenames

This patch makes it possible to put actual segment file size (measured
in bytes) and/or duration (calculated in microseconds) into segment
filenames. This feature is useful when post-processing live streaming
access log files. New behaviour works only when -use_localtime option
is set and second_level_segment_size or/and
second_level_segment_duration new hls_flags are specified. %%s is the
placeholder for size and %%t for duration in hls_segment_filename
option. Fix sized trailing zeropadding also works eg. %%09s or %%023t.

A command to test new features:
./ffmpeg -loglevel info -y -f lavfi -i color=c=red:size=640x480:r=25 -f
lavfi -i sine=f=440:b=4:r=44100 -c:v mpeg2video -g 25 -acodec aac
-cutoff 20000 -ac 2 -ar 44100 -ab 192k -f hls -hls_time 3 -hls_list_size
5 -hls_flags
-use_localtime 1 -use_localtime_mkdir 1 -hls_segment_filename
"segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts" stream.m3u8

doc/muxers: beside second_level_segment_duration and second_level_segment_size,
added some more details and example to hls_segment_filename,
use_localtime, use_localtime_mkdir, hls_flags. hls_flags option list
reformatted to table

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavformat/avidec: clean-up identifier names
Tobias Rapp [Thu, 22 Dec 2016 13:16:30 +0000 (14:16 +0100)]
avformat/avidec: clean-up identifier names

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/flvenc: Check for extradata allocation failure
Michael Niedermayer [Tue, 3 Jan 2017 02:03:31 +0000 (03:03 +0100)]
avformat/flvenc: Check for extradata allocation failure

Fixes CID1396539

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agowmavoice: validate block alignment
Andreas Cadhalpun [Sun, 1 Jan 2017 21:48:38 +0000 (22:48 +0100)]
wmavoice: validate block alignment

This prevents a division by zero crash in wmavoice_decode_packet.

The problem was introduced by commit

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agowmavoice: truncate spillover_nbits if too large
Andreas Cadhalpun [Sun, 1 Jan 2017 21:42:44 +0000 (22:42 +0100)]
wmavoice: truncate spillover_nbits if too large

This fixes triggering the av_assert0(ret <= tmp.size).

The problem was reintroduced by commit
7b27dd5c16de785297ce4de4b88afa0b6685f61d and originally fixed by

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
4 years agoavcodec/x86/vc1dsp_mc: Fix build with NASM 2.09.10
Michael Niedermayer [Mon, 2 Jan 2017 20:34:33 +0000 (21:34 +0100)]
avcodec/x86/vc1dsp_mc: Fix build with NASM 2.09.10

make fate passes

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/x86/imdct36: fix building with nasm 2.11.05
John Comeau [Sun, 1 Jan 2017 07:52:37 +0000 (23:52 -0800)]
avcodec/x86/imdct36: fix building with nasm 2.11.05

fixes `operation size not specified` errors as described here:

I rebuilt again with yasm and made sure it didn't break that.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/rtmphttp: fix bug for rtmphttp
Steven Liu [Mon, 2 Jan 2017 02:05:35 +0000 (10:05 +0800)]
avformat/rtmphttp: fix bug for rtmphttp

if the http server don't response the http command,
then the thread will be blocked and never be interrupted.

Reported-by: yinyunjiang <yinyunjiang1991@qq.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_pad: Fix segfault if reconfiguration fails
Michael Niedermayer [Mon, 2 Jan 2017 17:19:54 +0000 (18:19 +0100)]
avfilter/vf_pad: Fix segfault if reconfiguration fails

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavc/psd: Support indexed files.
Carl Eugen Hoyos [Mon, 2 Jan 2017 10:39:21 +0000 (11:39 +0100)]
lavc/psd: Support indexed files.

Fixes ticket #6045.

4 years agoconfigure: bump year
James Almer [Mon, 2 Jan 2017 04:38:03 +0000 (01:38 -0300)]
configure: bump year

Happy new year!

4 years agoavutil/tests: added selftest for aes_ctr.c
Thomas Turner [Sun, 1 Jan 2017 20:17:58 +0000 (12:17 -0800)]
avutil/tests: added selftest for aes_ctr.c

Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/tests/fft: Fix indention of dct_init()
Michael Niedermayer [Sun, 1 Jan 2017 21:28:28 +0000 (22:28 +0100)]
avcodec/tests/fft: Fix indention of dct_init()

Fixes CID1396253

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavf/img2dec: Increase detection score of jpgs without EOI.
Carl Eugen Hoyos [Sun, 1 Jan 2017 17:59:57 +0000 (18:59 +0100)]
lavf/img2dec: Increase detection score of jpgs without EOI.

Also increases the score for large jpeg files.
Fixes autodetection for the file from mpv issue 3973.

4 years agolavc/mjpegdec: Do not overread too short JFIF tags.
Carl Eugen Hoyos [Sun, 1 Jan 2017 13:19:48 +0000 (14:19 +0100)]
lavc/mjpegdec: Do not overread too short JFIF tags.

Fixes ticket #6055.

4 years agoavutil/tests: improved code coverage for atomic
Thomas Turner [Sun, 1 Jan 2017 04:42:40 +0000 (20:42 -0800)]
avutil/tests: improved code coverage for atomic

Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/nvenc: Add bluray_compat basic implementation
Miroslav Slugen [Fri, 30 Dec 2016 21:04:31 +0000 (22:04 +0100)]
avcodec/nvenc: Add bluray_compat basic implementation

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
4 years agoavcodec/nvenc: Make AUD optional for h264_nvenc and hevc_nvenc
Miroslav Slugen [Fri, 30 Dec 2016 21:02:42 +0000 (22:02 +0100)]
avcodec/nvenc: Make AUD optional for h264_nvenc and hevc_nvenc

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
4 years agoavcodec/nvenc: round qpIntra and qpInter calculation
Miroslav Slugeň [Thu, 29 Dec 2016 21:10:52 +0000 (22:10 +0100)]
avcodec/nvenc: round qpIntra and qpInter calculation

Round qpIntra and qpInter calculation instead of old floor behavior.

Adopted from vaapi_encode_h264.c

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
4 years agoavformat/hlsenc: Duplicated segment filenames and use_localtime_mkdir
Bela Bodecs [Sun, 1 Jan 2017 12:22:34 +0000 (20:22 +0800)]
avformat/hlsenc: Duplicated segment filenames and use_localtime_mkdir

Current implementation of finding duplicate segment filenames may fail
if use_localtime_mkdir and use_localtime are in effect and
segment_filename option expression contains subdirectories with
date/time specifiers. This patch fixes this false behaviour.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agolibavformat/hlsenc: default segment name and use_localtime
Bela Bodecs [Sun, 1 Jan 2017 03:00:45 +0000 (11:00 +0800)]
libavformat/hlsenc: default segment name and use_localtime

in hlcenc.c, in the hls_write_header() function the default format
string for strftime() function contains %s specifier when use_localtime
is true. This %s specifier will insert the seconds since EPOCH. But %s
is not available on all system/environment. This patch check %s
availabilty at runtine and alter the default format string if necessary.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agolibavutil/random_seed: Ensure that get_generic_seed() spends at least 1/32 sec gather...
Michael Niedermayer [Wed, 28 Dec 2016 23:34:57 +0000 (00:34 +0100)]
libavutil/random_seed: Ensure that get_generic_seed() spends at least 1/32 sec gathering entropy

This may fix the failures on windows

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agodoc: document cutoff option to ac3 and adjust the option's global documentation
Moritz Barsnick [Fri, 30 Dec 2016 17:08:14 +0000 (18:08 +0100)]
doc: document cutoff option to ac3 and adjust the option's global documentation

cutoff is implemented as an option global to lavc, but supported only
by a few encoders. This fact is now reflected in its documentation. ac3's
support of this option is added for completeness.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavc/libmp3lame: add support for cutoff
Moritz Barsnick [Fri, 30 Dec 2016 17:08:13 +0000 (18:08 +0100)]
lavc/libmp3lame: add support for cutoff

Pass the cutoff option from lavc's avcodec_options[] to libmp3lame's
lowpass option, without allowing to adjust its default behavior.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavutil/tests/audio_fifo.c: Memory leak and tab space fixes
Thomas Turner [Wed, 28 Dec 2016 02:43:19 +0000 (18:43 -0800)]
avutil/tests/audio_fifo.c: Memory leak and tab space fixes

Prevents memory leak when read_samples_from_audio_fifo() is
called more than once by deallocating before reallocating
more memory.

Fixes space indentation for contents in ERROR().

Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavutil/tests/audio_fifo.c: use av_malloc() family of functions
Thomas Turner [Wed, 28 Dec 2016 02:43:18 +0000 (18:43 -0800)]
avutil/tests/audio_fifo.c: use av_malloc() family of functions

Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoconfigure: Check build with some header not just preprocessing for testing --std=c11
Michael Niedermayer [Wed, 28 Dec 2016 22:41:29 +0000 (23:41 +0100)]
configure: Check build with some header not just preprocessing for testing --std=c11

Fixes build failure on FreeBSD with gcc 4.7

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavfi/selectivecolor: rename adjust_range to scale
Clément Bœsch [Sat, 31 Dec 2016 12:00:56 +0000 (13:00 +0100)]
lavfi/selectivecolor: rename adjust_range to scale

This variable corresponds to the final scale of the adjustement for a
given color range.

4 years agodoc/filters: Slightly improve the smartblur documentation.
Carl Eugen Hoyos [Sat, 31 Dec 2016 11:06:42 +0000 (12:06 +0100)]
doc/filters: Slightly improve the smartblur documentation.

Fixes ticket #6034.

4 years agoavcodec/mjpegdec: Check for rgb before flipping
Michael Niedermayer [Sat, 31 Dec 2016 02:08:33 +0000 (03:08 +0100)]
avcodec/mjpegdec: Check for rgb before flipping

Fixes assertion failure due to unsupported case

Fixes: 356/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_MJPEG_fuzzer
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavc/psd: Remove an uninitialized variable.
Carl Eugen Hoyos [Fri, 30 Dec 2016 11:08:26 +0000 (12:08 +0100)]
lavc/psd: Remove an uninitialized variable.

4 years agoconfigure: make the check for stdatomic.h stricter
James Almer [Wed, 28 Dec 2016 00:54:55 +0000 (21:54 -0300)]
configure: make the check for stdatomic.h stricter

Old ICC verions don't advertise having a full C11 implementation but
may nonetheless include a feature-incomplete stdatomic.h header.

Fixes ticket #6049

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/vf_pad: Add eval=frame support
Michael Niedermayer [Wed, 28 Dec 2016 01:35:14 +0000 (02:35 +0100)]
avfilter/vf_pad: Add eval=frame support

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavf/utils.c Protect against accessing entries[nb_entries]
Matt Wolenetz [Mon, 21 Nov 2016 23:54:02 +0000 (15:54 -0800)]
lavf/utils.c Protect against accessing entries[nb_entries]

In ff_index_search_timestamp(), if b == num_entries,
m == num_entries - 1, and entries[m].flags & AVINDEX_DISCARD_FRAME is
true, then the search for the next non-discarded packet could access
entries[nb_entries], exceeding its bounds. This change adds a protection
against that scenario. Reference: https://crbug.com/666770

Reviewed-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolibavformat/hlsenc: fix delete_segments when use_localtime_mkdir
Bela Bodecs [Thu, 29 Dec 2016 04:00:20 +0000 (12:00 +0800)]
libavformat/hlsenc: fix delete_segments when use_localtime_mkdir

When delete_segments hls_flag is specified, deleting old segments may
fail in certain cases when use_localtime_mkdir is in effect and
hls_segment_filename expression contains subdirs. This patch fixes this

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoffmpeg: remove stop_encoding variable and related code, it is dead / unused code
Michael Niedermayer [Mon, 26 Dec 2016 20:35:12 +0000 (21:35 +0100)]
ffmpeg: remove stop_encoding variable and related code, it is dead / unused code

Fixes: CID1396243

Reviewed-by: compn <tempn@mi.rr.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/avf_aphasemeter: make video output optional
Paul B Mahol [Wed, 28 Dec 2016 15:52:32 +0000 (16:52 +0100)]
avfilter/avf_aphasemeter: make video output optional

Signed-off-by: Paul B Mahol <onemda@gmail.com>
4 years agolibavformat/tee: Add fifo support for tee
Jan Sebechlebsky [Sun, 30 Oct 2016 18:18:21 +0000 (19:18 +0100)]
libavformat/tee: Add fifo support for tee

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
4 years agoavcodec/libopenjpegdec: Set key frame metadata
Michael Bradshaw [Wed, 28 Dec 2016 05:34:41 +0000 (21:34 -0800)]
avcodec/libopenjpegdec: Set key frame metadata

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavutil/tests/audio_fifo.c: Corrected test error messages
Thomas Turner [Wed, 28 Dec 2016 02:43:20 +0000 (18:43 -0800)]
avutil/tests/audio_fifo.c: Corrected test error messages

Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoaf_hdcd: more FATE tests
Burt P [Sun, 18 Dec 2016 06:20:48 +0000 (00:20 -0600)]
af_hdcd: more FATE tests

Additional/Modified FATE tests improve code coverage from 63.7% to 98.1%.

Changed fate-suite sample files:
* filter/hdcd-mix.flac (958K) added. It is a much better test than
  filter/hdcd.flac (910K), which is now unused, but can't be removed.
* filter/hdcd-fake20bit.flac (168K) added. It is the first second of
  filter/hdcd.flac, with the 16-bit LSB copied into bit 20 of a 24-bit
  stream. There isn't an actual non-16-bit HDCD sample available to test.

Signed-off-by: Burt P <pburt0@gmail.com>
4 years agolavfi/selectivecolor: simplify crazy mid val computations
Clément Bœsch [Tue, 27 Dec 2016 22:43:59 +0000 (23:43 +0100)]
lavfi/selectivecolor: simplify crazy mid val computations

4 years agolavfi/transpose: add missing const options flags
Clément Bœsch [Tue, 27 Dec 2016 08:36:18 +0000 (09:36 +0100)]
lavfi/transpose: add missing const options flags

Fixes ffmpeg -h filter=transpose

4 years agoMAINTAINERS: update
Christophe Gisquet [Tue, 27 Dec 2016 09:18:51 +0000 (09:18 +0000)]

4 years agowmavoice: protect against zero-energy in adaptive gain control.
Ronald S. Bultje [Tue, 20 Dec 2016 23:01:05 +0000 (18:01 -0500)]
wmavoice: protect against zero-energy in adaptive gain control.

Otherwise the scale factor becomes NaN, resulting in corrupt output.
Fixes #5426.

4 years agowmavoice: move overflow handling to common code.
Ronald S. Bultje [Tue, 20 Dec 2016 22:10:33 +0000 (17:10 -0500)]
wmavoice: move overflow handling to common code.

4 years agowmavoice: reindent.
Ronald S. Bultje [Tue, 20 Dec 2016 22:14:41 +0000 (17:14 -0500)]
wmavoice: reindent.

4 years agowmavoice: disable bitstream checking.
Ronald S. Bultje [Tue, 20 Dec 2016 22:14:26 +0000 (17:14 -0500)]
wmavoice: disable bitstream checking.

The checked bitstream reader does that already. To allow parsing of
superframes split over a packet boundary, we always decode the last
superframe in each packet at the start of the next packet, even if
theoretically we could have decoded it. The last superframe in the
last packet is decoded using AV_CODEC_CAP_DELAY.

4 years agowmavoice: move wmavoice_flush() up.
Ronald S. Bultje [Tue, 20 Dec 2016 22:03:46 +0000 (17:03 -0500)]
wmavoice: move wmavoice_flush() up.

4 years agocheckasm/vp9: benchmark all sub-IDCTs (but not WHT or ADST).
Ronald S. Bultje [Thu, 17 Nov 2016 21:08:20 +0000 (16:08 -0500)]
checkasm/vp9: benchmark all sub-IDCTs (but not WHT or ADST).

4 years agoavformat/hlsenc: strftime identifiers and segment index
Bodecs Bela [Tue, 27 Dec 2016 02:40:35 +0000 (10:40 +0800)]
avformat/hlsenc: strftime identifiers and segment index
 in filenames

Putting date/time values into segment filenames is very usefull.
But to produce non-conflicting segment filenames with -use_localtime
option with date/time
values in hls_segment_filename option, sometimes is not enough.
Like in cases when multiple segments produced in the same second.
But hlsenc currently does not make possible to use segment index (%d) at

same time whe use_localtime is in effect, due to identifier conflict.
This patch makes possible to use strftime identifiers and still put
segment index (%d) at same time in segment filenames by introducing
second_level_segment_index flag. When -use_localtime is active,
identifier %d is for month day index, so %%d is the segment index
placeholder. This enhanced behaviour only exists when new
second_level_segment_index flag is specified.
For instance putting 'segment_%Y%m%d%H%M%S_%%05d.ts' value into
-hls_segment_filename option and specifing -hls_flags
second_level_segment_index and -use_localtime 1, may produce segment
filename as 'segment_20161230235758_00002.ts'

An example:

ffmpeg -loglevel info -y -f lavfi -i color=c=red:size=640x480:r=25 -f
lavfi -i anullsrc=r=44100:cl=stereo -c:v mpeg2video -g 25 -acodec aac
-cutoff 20000 -ac 2 -ar 44100 -ab 192k -f hls -hls_time 3 -hls_list_size
5 -hls_flags delete_segments+second_level_segment_index -use_localtime 1
-hls_segment_filename "segment_%Y%m%d%H%M%S_%%05d.ts" stream.m3u8

will produce segments filenames:


Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
4 years agoFix bug when incrementing initial_prog_date_time when removing segments
Jesper Ek [Tue, 27 Dec 2016 02:10:44 +0000 (10:10 +0800)]
Fix bug when incrementing initial_prog_date_time when removing segments

initial_prog_date_time shouldn't be adjusted when deleting segments
from disk, but rather when segments are removed from the playlist.

Signed-off-by: Jesper Ek <deadbeef84@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavformat/matroskadec: Fix OOM on long streams
Michael Niedermayer [Mon, 26 Dec 2016 02:16:01 +0000 (03:16 +0100)]
avformat/matroskadec: Fix OOM on long streams

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavdevice/decklink_enc: do not reference this after freeing it
Marton Balint [Sat, 10 Dec 2016 12:57:01 +0000 (13:57 +0100)]
avdevice/decklink_enc: do not reference this after freeing it

Fixes Coverity CID 1396863.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavdevice/decklink_dec: properly initialize no_video variable
Marton Balint [Sat, 10 Dec 2016 12:20:31 +0000 (13:20 +0100)]
avdevice/decklink_dec: properly initialize no_video variable

Fixes Coverity CID 1396859.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoffmpeg: Check avcodec_parameters_to_context() for failure
Michael Niedermayer [Mon, 26 Dec 2016 19:25:23 +0000 (20:25 +0100)]
ffmpeg: Check avcodec_parameters_to_context() for failure

Fixes CID1396241

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/ylc: thread safe initialization is possible with this codec
Paul B Mahol [Mon, 26 Dec 2016 19:28:40 +0000 (20:28 +0100)]
avcodec/ylc: thread safe initialization is possible with this codec

Signed-off-by: Paul B Mahol <onemda@gmail.com>