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)
doc/encoders: Add documentation for libmp3lame

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

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/encoders: add documentation for libtwolame
(cherry picked from commit ea038b996d5662702b2247a6aa919dee1cebc0be)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/encoders: Add libvo-aacenc doc

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

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/encoders: Add libvo-amrwbenc doc

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

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	doc/encoders.texi
doc/general: Make the license status of the Android libraries clearer

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

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/decoders: Document libcelt

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

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/encoders: Add libopencore-amrnb doc

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

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/decoders: Document libgsm decoder

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

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/decoders: Document libilbc decoder

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

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/decoders: Document libopencore-amrnb decoder

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

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/decoders: Add libopencore-amrwb decoder doc

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 83647ace735d1707d4b28345ef77fefe525ea52e)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/encoders: alphabetically list the encoders

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 934df3b0375743ae2b03168a4174edb9f88a6889)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	doc/encoders.texi
doc/muxers: Add AIFF doc

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 4ec46b1160eb549a551823c168905b43922add31)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
doc/encoders: add libxvid doc

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 6b255e5e70c72aa59ff7aed74b4ee976223eb140)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	doc/encoders.texi
doc: remove mention of fifo filter in the introduction.

It's confusing and not necessary, especially in the introduction.
(cherry picked from commit 80a9297b711b7acb152ebbf84b28772945f920ea)

Signed-off-by: Timothy Gu <timothygu99@gmail.com>
avformat/matroskadec: check out_samplerate before using it in av_rescale()

Prevent assertion failure with damaged input

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 338f8b2eaf36f078eb5cc26ac10e651dc4c48243)
doc/encoders: Remove reference to "Codec Options" chapter

The chapter is only presented in later release branches.