Commit Graph

66426 Commits

Author SHA1 Message Date
Dave Yeo
d48e0aed3c libavutil/threads.h: correct an include to be local
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32eadfe453)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-29 12:07:17 +01:00
Dave Yeo
89b52d25b4 libavutil/thread.h: Support OS/2 threads
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 090a7801a8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-29 12:07:17 +01:00
Michael Stypa
9984d492dc fix Makefile objects for pulseaudio support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb58c771ad)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 21:31:26 +01:00
Michael Niedermayer
56b84b023d Merge commit 'ca78ee73db9e059f501706ba6108e23902e84933' into release/2.4
* commit 'ca78ee73db9e059f501706ba6108e23902e84933':
  opusdec: make sure all substreams have the same number of coded samples

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 01:19:28 +01:00
Michael Niedermayer
0e216ed407 avutil/buffer_internal: leave the buffer pool entries volatile
Theres no reason to remove the volatile keyword in a release branch

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 01:17:56 +01:00
Michael Niedermayer
f783259fdb avutil/buffer: use the old atomics based code for the release branch
the old code worked fine for a long time and was not affected by
the bug the new code fixes and the new is not widely tested yet.
This can be reverted once the code received more testing in
master

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 01:15:11 +01:00
Michael Niedermayer
b6691fba77 Merge commit '517ce1d09b5e6b72afc2ef9490b5f8ca42fa6a65' into release/2.4
* commit '517ce1d09b5e6b72afc2ef9490b5f8ca42fa6a65':
  lavu: fix memory leaks by using a mutex instead of atomics

Conflicts:
	libavutil/buffer.c

The atomics code is left in place as a fallback for synchronization in the
absence of p/w32 threads. Our ABI did not requires applications to
only use threads (and matching ones) to what libavutil was build with
Our code also was not affected by the leak this change fixes, though
no question the atomics based implementation is not pretty at all.
First and foremost the code must work, being pretty comes after that.

If this causes problems, for example when libavutil is used by multiple
applications each using a different kind of threading system then the
default possibly has to be changed to the uglier atomics.

See: cea3a63ba3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 01:00:50 +01:00
Michael Niedermayer
15fd62110f Merge commit '46a17d886b8559723c40b9f5cdf0e0c6b1c95180' into release/2.4
* commit '46a17d886b8559723c40b9f5cdf0e0c6b1c95180':
  lavu: add wrappers for the pthreads mutex API

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 00:36:23 +01:00
Michael Niedermayer
86b532898d Merge commit '12700b0219521a5f20c8ba47b3ad7857ea9e0554' into release/2.4
* commit '12700b0219521a5f20c8ba47b3ad7857ea9e0554':
  mp3enc: fix a triggerable assert

Conflicts:
	libavformat/mp3enc.c

No change as the faulty assert is not in FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 00:35:35 +01:00
Anton Khirnov
ca78ee73db opusdec: make sure all substreams have the same number of coded samples
Fixes invalid writes with invalid multichannel streams.

CC:libav-stable@libav.org
(cherry picked from commit 1973079417)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 14:11:51 +01:00
wm4
517ce1d09b lavu: fix memory leaks by using a mutex instead of atomics
The buffer pool has to atomically add and remove entries from the linked
list of available buffers. This was done by removing the entire list
with a CAS operation, working on it, and then setting it back again
(using a retry-loop in case another thread was doing the same thing).

This could effectively cause memory leaks: while a thread was working on
the buffer list, other threads would allocate new buffers, increasing
the pool's total size. There was no real leak, but since these extra
buffers were not needed, but not free'd either (except when the buffer
pool was destroyed), this had the same effects as a real leak. For some
reason, growth was exponential, and could easily kill the process due
to OOM in real-world uses.

Fix this by using a mutex to protect the list operations. The fancy
way atomics remove the whole list to work on it is not needed anymore,
which also avoids the situation which was causing the leak.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit fbd6c97f9c)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:38:29 +01:00
Anton Khirnov
46a17d886b lavu: add wrappers for the pthreads mutex API
Also add no-op fallbacks when threading is disabled.

This helps keeping the code clean if Libav is compiled for targets
without threading. Since we assume that no threads of any kind are used
in such configurations, doing nothing is ok by definition.

Based on a patch by wm4 <nfxjfg@googlemail.com>.

(cherry picked from commit 2443e522f0)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:38:27 +01:00
Michael Niedermayer
944570906b avformat/avidec: fix handling dv in avi
Fixes Ticket4086

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f0ae0354d3)
2014-11-21 09:30:59 +01:00
Peter Ross
057ee35924 avfilter/vf_lut: gammaval709()
See http://www.itu.int/rec/R-REC-BT.709
Item 1.2, overall opto-electronic transfer characteristics at source

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b186b7131e)
2014-11-20 02:00:59 +01:00
Peter Ross
e386241d54 cinedec: report white balance gain coefficients using metadata
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2093c1dc51)
2014-11-20 02:00:49 +01:00
Michael Niedermayer
222236317b swscale/utils: support bayer input + scaling, and bayer input + any supported output
Fixes Ticket4053

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2f6bb86f85)
2014-11-20 02:00:35 +01:00
Michael Niedermayer
633a2a082f swscale: support internal scaler cascades
Fixes Ticket3170

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fba894615d)

Conflicts:
	libswscale/version.h
2014-11-20 02:00:15 +01:00
Michael Niedermayer
e5f5df37c8 avformat/dtsdec: dts_probe: check reserved bit, check lfe, check sr_code similarity
Fixes misdetection of s16le
Fixes Ticket4109

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0dba982bb4)
2014-11-20 01:29:20 +01:00
Michael Niedermayer
cc9c74ea87 avformat/segment: export inner muxer timebase
Fixes "Non-monotonous DTS in output stream 0:0"
Fixes Ticket4020

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ce80f9fee9)
2014-11-17 01:08:48 +01:00
Anton Khirnov
12700b0219 mp3enc: fix a triggerable assert
We have to check against the number of bytes actually needed, not the
theoretical maximum size.
2014-11-14 20:22:40 +01:00
Reimar Döffinger
3e0802e42b configure: Hack to treat x32 as x86_64.
Allows shared compilation on x32 with --disable-asm.
(cherry picked from commit 5e8e2f3861)
2014-11-13 08:24:55 +01:00
Michael Niedermayer
56e11cbe32 Revert "v4l2: setting device parameters early"
This reverts commit b1ad931233.

Fixes Ticket #3517

Requested-by: Giorgio Vazzana <mywing81@gmail.com>
Merged-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6f21fb7932)

Conflicts:
	libavdevice/v4l2.c
2014-11-08 14:21:46 +01:00
Carl Eugen Hoyos
2be7d565bb Remove fminf() emulation.
The emulation is unused and causes compilation trouble on systems
where fminf() is defined in <math.h> but missing from libm.
This should fix compilation on Debian powerpcspe.
(cherry picked from commit 4436a8f44d)
2014-11-08 12:47:18 +01:00
Michael Niedermayer
c7b64a904a avcodec/mpegaudio_parser: fix off by 1 error in bitrate calculation
Fixes Ticket3918

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 817663897e)
2014-11-06 01:02:53 +01:00
Carl Eugen Hoyos
9798dc8061 Use -fno-optimize-sibling-calls on parisc also for gcc 4.9.
Fixes fate on hppa.
Found-by: Andreas Cadhalpun.
(cherry picked from commit f2ffaae9ac)
2014-11-05 10:32:24 +01:00
Michael Niedermayer
a5cc8775cf avcodec/h264_sei: ff_h264_decode_sei: dont try to parse trailing zeroes
reduces noise for tserrors.ts

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 688a40b4ed)
2014-11-05 10:13:26 +01:00
Michael Niedermayer
f9ca1fecb0 ffmpeg_opt: store canvas size in decoder context
Fixes canvas size
Fixes Ticket4074

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 66b9e60af0)
2014-11-05 09:54:35 +01:00
Michael Niedermayer
cd57d608a4 avcodec/mpeg12dec: do not trust AVCodecContext input dimensions
Fixes initial wtv dimensions
Fixes Ticket4070
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 77f1199e8f)
2014-11-05 09:52:29 +01:00
Michael Niedermayer
043f326060 avcodec/h264_slice: Clear table pointers to avoid stale pointers
Might fix Ticket3889

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 547fce9585)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-02 02:10:51 +01:00
Michael Niedermayer
9a641b909c avcodec/h264_parser: rewrite the parse_nal_units() loop logic based on h264.c
Fixes Ticket4011

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 69a9a90d2e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 16:27:12 +01:00
Michael Niedermayer
5405ba7b63 avcodec/h264: simplify find_start_code()
this also uses avpriv_find_start_code(), though no speed change is expected as
the area searched is generally small

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3b678da5e3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 16:27:12 +01:00
Michael Niedermayer
70f6d553d9 Move get_avc_nalsize() and find_start_code() to h264.h
This allows sharing them with the h264 parser

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4898440f6b)

Conflicts:

	libavcodec/h264.c
2014-11-01 16:27:12 +01:00
Reimar Döffinger
25fc3deed8 mpeg4vdpau: Fix priv data size.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 46353759cb)
2014-11-01 16:18:50 +01:00
Michael Niedermayer
a8a6cdfcd7 avformat/matroskadec: do not trust the default duration to be the real 1/timebase if its less than 5fps
Fixes Ticket3980

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be695ee389)
2014-11-01 15:37:36 +01:00
Michael Niedermayer
39518589e7 avformat/options_table: add FF_COMPLIANCE_UNOFFICIAL
Fixes ticket 3959

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c02ea58c5f)
2014-11-01 15:36:07 +01:00
Carl Eugen Hoyos
857e391697 Stop demuxing wtv on eof.
Fixes ticket #3991.
Fixes ticket #3995.
Fixes ticket #3997.

Reviewed-by: Peter Ross
Reviewed-by: Paul B Mahol
(cherry picked from commit 6efe4137ce)
2014-11-01 15:35:46 +01:00
Michael Niedermayer
04aa2ffbcf Update for 2.4.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:39:52 +01:00
Michael Niedermayer
63523485f4 avcodec/svq1dec: zero terminate embedded message before printing
Fixes out of array access
Fixes: asan_stack-oob_49b1e5_10_009.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e91ba2efa9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Michael Niedermayer
35bc67503e avcodec/cook: check that the subpacket sizes fit in block_align
Fixes out of array read
Fixes: asan_heap-oob_fb5c50_19_018.rmvb
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 10e32618ac)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Michael Niedermayer
1f636a697f avcodec/g2meet: check tile dimensions to avoid integer overflow
Fixes out of array access
Fixes: asan_heap-oob_12a55d3_30_029.wmv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32e666c354)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Michael Niedermayer
24d725f455 avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
Fixes: out of array accesses
Fixes: asan_heap-oob_112c6b3_13_012.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit df74811cd5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Michael Niedermayer
66fcf1fa40 avcodec/dnxhddec: treat pix_fmt like width/height
Fixes out of array accesses
Fixes: asan_heap-oob_22c9a39_16_015.mxf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f3c0e0bf6f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Michael Niedermayer
c7b7e0790c avcodec/dxa: check dimensions
Fixes out of array access
Fixes: asan_heap-oob_11222fb_21_020.dxa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e70312dfc2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Michael Niedermayer
3f3e5f8f60 avcodec/dirac_arith: fix integer overflow
Fixes: asan_heap-oob_1078676_9_008.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 39680cacee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Michael Niedermayer
8e95ddbe82 avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
Fixes very long but finite loop
Fixes: asan_heap-oob_107866c_42_041.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5145d22b88)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Michael Niedermayer
8cba067fe5 avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
Fixes integer overflow
Fixes out of array read
Fixes: asan_heap-oob_107866c_42_041.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 526886e606)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Michael Niedermayer
73c6520c09 avcodec/sgidec: fix count check
Fixes: asan_heap-oob_22b30d4_39_038.sgi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a050cf0c45)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Michael Niedermayer
ca47574e16 avcodec/sgidec: fix linesize for 16bit
Fixes: asan_heap-oob_22b30d4_39_038.sgi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3b20ed8548)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Michael Niedermayer
045670a6f7 avcodec/hevc_ps: Check default display window bitstream and skip if invalid
Fixes Ticket4035

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 852aaead1f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:14 +01:00
Christophe Gisquet
30a0622a5d avcodec/tiffenc: properly compute packet size
The bytes per row is a better indication of it.

Helps resolving ticket #3874 by fixing ffmpeg's encoder and transforming
the issue in a issue with non-compliant decoders. ffmpeg's one is ok,
but unfortunately, many others aren't handling correctly unusual chroma
samplings.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0e8bfd3c93)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:13 +01:00