avcodec/utils: Fix encoder allocation size

Fixes Ticket2645
Found-by: Darrell Walisser
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 175e916fa20b7887bdb29809817985e481ae0888)

Conflicts:
	libavcodec/utils.c
Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
alacenc: Fix missing sign_extend()

Fixes ticket #2497

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8aea2f05dc56f7e7d60767dd27ba8e846a05e8ae)
Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
vaapi: return early from ff_vaapi_render_picture() without picture

Fixes an assertion when called on uninitialized frame. Spotted after
seeking in vlc.
Fixes ticket #2461.

Tested-by: Timo
Reviewed-by: Joakim Plate
Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
(cherry picked from commit 2ee380aefbb92c89e8e9c7aa5846aa404919ec7c)
Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
swresample/x86/audio_convert: add emms to CONV

Fixes ticket #1874

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ca2818b88155029bb6f989ee522e7f8e9e9f5927)
Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
ff_gen_search: make step 64 bit to prevent hypothetical integer overflow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9d73e302537144877ca9d5b648b21aca28b78f4f)
Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
ff_gen_search: fix limit

The limit value could become slightly wrong in the last iteration

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b3dd50cd0dbbda08610b75384128f5f47f5199d9)
Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
ff_gen_search: fix infinite loop

Fixes Ticket2639

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f8ca8138f01d0a7d96d4e1ea65fecd1197f96206)
Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
Autodetect idcin only if audio properties allow decoding.

Fixes ticket #2688.
(cherry picked from commit 06bede95fcea47d2e51e8ff248c15311f335b898)

Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
Re-sync FFmpeg with latest fixes
Revert "ELD: Fix Coverity ID 700794 Uninitialized scalar field"

This reverts commit 8ea8dcc9005b87d5b58918269a54576c83ac9679.
Fix coverity false positive.

eld_data would have been initialised in update_sad. In the other constructor, no field is ever accessed as the eld is marked as invalid.

So add default constructor to eld_data
Revert "Revert 3e30a16 which broke stereo upmixing of mono audio and apply a better fix."

This reverts commit 59f272c1e73ed7e36b37bff62f76b1f37083711a.
Revert "AudioOutputBase: Fix Coverity 746810. Dereference after null check. False positive, and flagged as such with Coverity, but applying a 'fix' anyway to keep other SA tools quiet."

This reverts commit 3e30a164ddf761c2dfa2b2a50ddaea09669d63b3.
Simplify code to make it more explicit and remove Coverity false positive

needs_upmix can only be set to true if supported channel configuration.
new operator can't return null, so no need to test otherwise.
Only case we can have needs_upmix set and upmixer isn't ; it's when doing mono -> stereo
Small optimisation for interleaving mono audio.

MP3 mono are flagged are being S16 planar, which launch the interleaver.
Rewrite MythMusic avfdecoder.

Simplify logic. Preparing data to give toaudio framework was done in 3 separate phases with no real benefit. Now write to audio as we decode it, always ensuring we have one second buffered.
There was a small memory leak whenever we were changing song; the FFmpeg code wasn't closed losing 1088 bytes.