lavd/v4l2: do not fail when VIDIOC_ENUMSTD returns EINVAL without a valid match

With some (buggy) drivers, the VIDIOC_G_STD ioctl returns a std_id that cannot
be matched with any of the enumerated v4l2_standard structures (for example
std_id = 0 or std_id = 0xffffff). Do not fail when we reach the end of the
enumeration without a valid match.

Fixes ticket #2370

Note: This commit message has been modified by Giorgio Vazzana, the original
commit message was:

"Fixed regression for mandatory VIDIOC_ENUMSTD support by v4l2"

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ed72542539fb61dc3a6d6280d8a6a956ac04a071)
avcodec/h264_refs: modify key frame detection heuristic to detect more cases

Fixes Ticket2968

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5ac6b6028f17b64723884c9fa72cfcbd369a1ba2)
avformat/wavdec: Dont trust the fact chunk for PCM

Fixes Ticket3033

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 83fc6c822b06688e572333299927d93eb3c6c426)
avformat/matroskadec: only set r_frame_rate if the value is within reasonable limits

Fixes Ticket2451

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6853e40106cac769f0641183ea0bdd530ae9a0a1)
avformat/gifdec: make GIF_APP_EXT_LABEL parsing more robust

Fixes Ticket3021

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e1f8184a1a973fd7de1bf53578d09661ec7bad75)
avformat/mov: force parsing of headers if stts is absent

Fixes Ticket2991

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e41ea866fc26f38d770bbc1ad67703e7f4400ae1)
doc/Makefile: fix man pages uninstall path

Fix trac ticket #3054.
(cherry picked from commit af1c5388501e80e6d92704bb70610998226e5e51)
avcodec/h264: do not trust last_pic_droppable when marking pictures as done

This simplifies the code and fixes a deadlock

Fixes Ticket2927
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 29ffeef5e73b8f41ff3a3f2242d356759c66f91f)
avformat/wavdec: Fix smv packet interleaving

This strips the relative timestamp "flag" off.

Fixes Ticket2849

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6abb9eb525239f954ec12e52fc209e6dfce2a6d4)
avformat/mp3dec: perform seek resync in the correct direction

Fixes seeking to the last frame in CBR files
Fixes Ticket2773

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ba8716df7fb541fb690d1a898cda0e12f9011faf)
avcodec/h264: reduce noisiness of "mmco: unref short failure"

Do not consider it an error if we have no frames and should discard one.
This condition can easily happen when decoding is started from an I frame

Fixes Ticket2811

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 08a89761964bdd0a023eff6d37a1131fb7e1d7a0)
h264: make flush_change() set mmco_reset

This ensures that frames do not get mixed on context reinits

Fixes Ticket2836

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