Only test the first frame for missing aac_adtstoasc bistream filter.

Many players ignore broken aac frames, so don't abort mov or flv
muxing when encountering one, just print a warning instead.

Fixes ticket #2380.
(cherry picked from commit 1741fece7073f51efdd837a4f307ea2cdf3d1cfb)

Conflicts:
	libavformat/flvenc.c
Write broken aac frames to mov files instead of skipping them.

Fixes decoding with picky media players.

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

Conflicts:
	libavformat/movenc.c
smacker: fix off by one error

Regression since a93b572ae4f517ce0c35cf085167c318e9215908.

Fixes #2426.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit e3cc92a623a6ece42816c7a692c8815688a99ab0)
Fix type of shared flac table ff_flac_blocksize_table[].

Fixes ticket #2533.
(cherry picked from commit a07ac1f7888fd08e42da2bed0421e74f1cfac177)
matroska: set "done" only during resync fail.

Fixes playback of test7.mkv validation test file.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit 762d4335aec2e5299a06bfbce15d21336af19464)
Do not read strd chunk in avi files as H264 extradata.

Fixes ticket #2561.
(cherry picked from commit 231b3317184790b6be4b4619d96fd328f13aeabb)
avidec: dont randomly skip packets for offseting the index

Fixes Ticket2490

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6c593f1b671b7725b8c36f92f7c0a23ccf8e7628)
smacker: remove av_clip_int16()

Fixes Ticket2425

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2211c76287e073a9e176fde7dbb9a63ceb2af8d1)
avienc: Disallow the first frame to be skiped

Fixes Ticket2386

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

Conflicts:
	libavformat/avienc.c
h264_cavlc: fix reading skip run

Fixes Ticket2606

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

Conflicts:
	libavcodec/h264_cavlc.c
AAC encoder: Fix rate control on twoloop.

Fixes a case where multichannel bitrate isn't accurately
targetted by psy model alone, never achieving the target bitrate.
Now fixed.

Fixes ticket #2625.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
alacenc: Fix missing sign_extend()

Fixes ticket #2497

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8aea2f05dc56f7e7d60767dd27ba8e846a05e8ae)
swresample/x86/audio_convert: add emms to CONV

Fixes ticket #1874

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ca2818b88155029bb6f989ee522e7f8e9e9f5927)
Autodetect idcin only if audio properties allow decoding.

Fixes ticket #2688.
(cherry picked from commit 06bede95fcea47d2e51e8ff248c15311f335b898)
avformat/libmodplug: Reduce the probe score for small input

This ensures that theres enough data for mpeg_probe() to recognize mpeg-ps
Fixes Ticket2583

Based on code by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c605adbf562fbf535e83ae427bb681bc45e440c8)
mathops/x86: work around inline asm miscompilation with GCC 4.8.1

The volatile is not required here, and prevents a miscompilation with GCC
4.8.1 when building on x86 with --cpu=i686

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 659df32a9d8984081ccd54adc3aee7daeb33388d)
rmdec: Pass AVIOContext to rm_read_metadata()

Fix null pointer dereference
Fixes Ticket2588

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

Conflicts:
	libavformat/rmdec.c
mpegts: only reopen pmt_cb filter if its different from the previous.

Fixes Ticket2632

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b009267910df10c004b5f340a090d45da29089a0)
avformat/mov: Fix duration of fragmented mov

Fixes Ticket2757

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dc2a13aa802fc691c25d5e0194818831058316ee)
mmsh: dont close context on seeking failure

Fixes Ticket2581

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