FFmpeg resync to release/1.1 branch as of revision 057051b8

Only tested to compile properly on both mac and linux.
Fix compilation of LIRC client with updated clang.

It refuses to compile arrays of variable length. Using malloc instead
Fix compilation issue

Was missing the definition of strcasecmp
Fix compilation issue

Was missing the definition of strcasecmp
Fix compilation

strncmp is in string.h not strings.h
Fix compilation issue.

Add missing header to common header, hopefully this will prevent similar instances to keep popping up
fix issue #10222: mythcommflag segfaulting

The problem in issue #10222 is that it is adding the CODEC_FLAG2_FAST flag.  This causes unsafe functions to be used, causing a segfault. The proper way to fix this would probably be to figure out how to test for the "experimental speedups" flag, however I don't know the codebase well enough for this.

I tested how this would affect the speed of mythcommflag on one of my recordings.  The results:

Before removing flag:
real 2m13.123s
user 2m16.713s
sys 0m3.502s

After removing flag:
real 2m13.021s
user 2m15.446s
sys 0m3.758s
FIx video scanning following [a05b4d48]. Calling QDir::setFilter() with a negative filter overwrites the default positive filters of QDir::Files | QDir::Dirs.
Generally empty()/isEmpty() is more efficient than using size()
Few more size() replacements with empty() or isEmpty(). Silences some warnings from cppcheck and other SA tools.
Make sure forked process has stopped when deleting MythSystem

This forces a termination in a forked MythSystem process when the
MythSystem object is destroyed, preventing a situation where the private
internal object tries to access resources from the no-longer-existent
parent object.

Fixes #11412
Called methods against wrong object in destructor.

Refs #11412
Sync libdvdnav up to R1251.

* Fix failed assertion when there's no menu.
* Make sure we get nav packets for all cells in multi angle features
* Fix strict aliasing warnings.

Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
Sync libdvdread to R1250:

* Accommodate duplicate language units and pgcs (avoid potentially consuming large amounts of memory)
* Fix a segmentation fault by preventing a read/write beyond end of an array due to using a length value taken from the DVD, which can exceed the allocated size.

Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
Fix h.264 frame/keyframe identification in the player.

If a NAL unit that determines a frame start appears as the last NAL
unit in the packet, then the frame start is not identified until the
start of the next packet.  If this new packet has its own NAL unit
that determines a frame start, and that NAL unit is not at the end of
the packet, then only one frame start would be counted rather than
two.  This is fixed by returning the total number of frame starts,
rather than a bool.

In theory, the same problem could exist in the recorder, but it
appears that the packets in the original recording may have some
trailing NAL units that are stripped by the ffmpeg libraries when
assembling the packet for the player, causing the situation not to
occur.
Add test target to base makefile and the libs makefile.

This introduces a script called unittests.sh which locates all files
matching test_*.pro and then runs the tests those are expected to
generate and complains if either the tests fail or it can't find
the test executable. This script is run on both make test in the
mythtv directory and make test in the mythtv/libs directory.

The lib*/test directories have been added to the subdirs that
libs.pro compiles and a clean of the test_mythtimer.pro target has
been added. This allows a make in mythtv or mythtv/libs to compile
the unit test and a make clean to remove it. It would be nice to
have these targets work from mythtv/libs/libmythbase, but I don't
know how to do that with the current .pro file arrangement.

Note: This and the MythTimer unit test are intended as templates
for other unit tests. Any suggestions for improvement are welcome.
Add unistd.h include for usleep in unit tests.
Add coverage to the unit test framework.
Fix clang build.
Fix broken formatting string (%lld for uint), use QString instead (clang).