mpeg12dec: avoid reinitialization on PS changes when possible.

Fixes Ticket2574

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

Conflicts:
	libavcodec/mpeg12dec.c
avformat/matroskadec: Detect conflicting sample rate/default_duration

Fixes Ticket2508

Thanks-to: Moritz Bunkus
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6158a3bcdf52fafc1d9ae9eb358a56c614b23aa3)
avformat/utils: Keep internal and external av_read_frame() packets in sync.

Otherwise, during error conditions, the caller will be left with
dangling pointers to a destructed packet => boom.

BUG=242786
TEST=ffmpeg_regression_tests

Commit slightly simplified by commiter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c54a1565f512858ccfa70392f40f11c098bc1b63)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
update all trac links to use the trac subdomain

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swfdec: check lens validity

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swfdec: do better validation of tag length

Avoids trying to read a packet with 0 or negative size.
Avoids a potential infinite loop due to seeking backwards.

Partially based on a patch by Michael Niedermayer.
(cherry picked from commit e70c5b034c4787377e82cab2d5565486baec0c2a)

Conflicts:

	libavformat/swfdec.c
Merge remote-tracking branch 'jamrial/release/1.0' into release/1.0

* jamrial/release/1.0:
  oggparseskeleton: avoid header parsing failure
  oggparseskeleton: Replace avpriv_report_missing_feature() with a normal av_log() call
  oggparseskeleton: Fix fisbone header parsing

Merged-by: Michael Niedermayer <michaelni@gmx.at>
avformat/dtsdec: Improve probe, reject things looking like analog signals

Fixes Ticket2810

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

Conflicts:
	libavformat/dtsdec.c
avcodec/kmvc: fix MV checks

Fixes Ticket2813
Fixes regression since 70b5583

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3cd8aaa2b2e78faf039691e1c31ff4f8d94e3bc6)
movenc: ilbc needs audio_vbr set.

Without this the block_align or bitrate value is not available to the decoder

Fixes Ticket2858

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3d64845600c6486a2706b118a81805f3bf4d3db5)
swr: clean layouts before checking sanity

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6dfffe92004dfd8c79d18791f28a2b1c7e387845)
swr/rematrix: Fix handling of AV_CH_LAYOUT_STEREO_DOWNMIX output

Fixes Ticket2859

Note, testcases related to the downmix channels are welcome.
(id like to make sure this is working correctly now, as obviously it didnt
 work before ...)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c56d4dab039b352961cca298d753b04e2f2fd990)
lavf/matroskaenc: Check for valid metadata before creating tags

Tags must have at least one SimpleTag element to be spec conformant.
Updated lavf-mkv and seek-lavf-mkv FATE references as the tests were affected by
this.

Fixes ticket #2785

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 088ed5314694031e07e02e9d364c9d486a60e704)

Conflicts:
	tests/ref/lavf/mkv
	tests/ref/seek/lavf_mkv
matroskaenc: simplify mkv_check_tag()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 066111bf19518a9f4d836991b34dbfc5ab72a41a)
matroskadec: Improve TTA duration calculation

Calculate the duration as accurately as possible to improve decoding of samples
where the last frame is smaller than the rest.

Signed-off-by: James Almer <jamrial@gmail.com>
Approved-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit af248fa1174200acb537a6ab1198bb2fed38e884)