Merge branch 'master' of github.com:MythTV/mythtv

Conflicts:
	mythtv/libs/libmythbase/mythversion.h
Revert "Fix potential leak"

This reverts commit f31d9a72aac1af4074cc7c7df5e99401977ad422.

Actually, completely unecessary as KillAudio would have deleted the encoder
Partially revert 5dccbd5f6b3019a67ecc69213ee405bba4b30994

While this worked when using Qt frameworks on a mac, when using Qt libs I was seeing the same issue as in edae94e0458a9b7fc054adb2f0a1df7882929775.
Basically, it would like with old mythtv libs.

Rework the changes so we do reset QMAKE_LIBDIR_QT when not using Qt frameworks on a mac
Fully clear the audio ringbuffer when using AC3 re-encoder

When the audio buffer was reset, we could find ourselves in a situation where a full audio frame may not have fitted at the end of the ring buffer. This would have resulted in channels being shifted for a short period of time when we rollled over in the buffer.
This situation could only happen when using the AC3 encoder as we change the size of an audio frame half-way through.

When the AC3 re-encoder is in use, we now fully clear the audio buffer and fill it with zero. That way at worse we hear silence instead of crap and not have to worry about threading issues.

Add some extra logging that will clearly show an error should this condition occurs again. Will help troubleshoot should any issues remain.

Additionally, from Mark Spieth, fully reset any audio processing unit that could have cached old audio.

Should fix #10396
Thanks Mark for actually spotting what went wrong
Add debugging for the DVD audio language extension code which may prove useful in the future.
Don't increment the number of channels returned by libdvdnav. This was causing 5.1 audio to be wrongly identified as 7 channel, and stereo as 3 channel.
Subtitles: Try to reenable the previously selected caption type.

During DVD playback with AVSubs enabled, once in a while the decoder
disables and reenables subtitles.  If the DVD also contains cc608
captions, the caption priority order would favor cc608 and the user
would need to reselect AVSubs every time this happens.  To fix this,
we keep track of the previously selected caption type and default to
that if possible when captions are turned on.  This is in addition to
the existing code that tries to reselect the previous AVSubs track
when AVSubs are enabled.
Call DestoyMythMainWindow() before exit, even on error exits.
Only display the standby screen if the master backend is configured to shut down when idle. We can assume that if the user hasn't configured their backend to shut down then they don't care to know that the frontends are idle.
Rename 'Enable/Disable Flat view' in the video browser to 'Show/Hide Directory Structure' to try and reduce the confusion this mode currently causes.
Rename 'file browse mode' to try and discourage it's use. Browsing the database is now 'Browse Library (recommended) and what was called file browse is now 'Browse Filesystem (slow)'
Missed a change from 1a651934c
Make sure we cleanup DB connections before thread exit (non-MThread).

Threads not using MThread needed to cleanup DB connections themselves, any many
did not. This adds MThread::ThreadSetup() and MThread::ThreadCleanup() to be called
by such threads to handle this job.

threadRegister() and threadDeregister() have been renamed and they are no longer
available for use outside libmythbase since they are called by these new MThread
functions.
Close DB connections before running jobs.

These connections will likely timeout anyway during something like
a commflagging or transcode job and if we exit the backend while
one of these jobs is running while we still have a DB connection
we don't get a clean exit.
Slight mod on [be81782c0] (function names).
Prevent showing 0x0 artwork when a recording doesn't have Seas/Ep.

I am not sure why this solution didn't occur to me earlier,

Basically, if the season input to the methods is 0, just order
the season results descending.  That way if the user has set
artwork (or any artwork has been set for anything > 1x01),
it'll be shown in higher priority than the 0x0 artwork.

The bug still exists (it's just inverted now, you'd get TV results
if you actually had TV and movies with the same legit inetref,
but this should affect far, far, far fewer people. Many/most users
will probably never see this inversion of the bug at all.

Refs #10408
Identify DVD commentary tracks in the Audio track selection dialog.
Update Youtube player API to v3.

Thanks to Alex Halovanic for this change, allows playback for those
videos which attempt to play advertisements first.

Fixes #10463.
Make users have to figure out if their video works

Make new users use the old, legacy, UI painter that doesn't work
properly with some themes and that's missing features.  This way, people
just starting with MythTV will be stuck with using the wrong painter
unless they happen to notice the setting buried in frontend Setup, and
they happen to read the help text which says that the default value is
only for use on systems with broken OpenGL (either broken hardware
or--more likely--broken drivers or possibly even broken higher-level
software, such as X or Window Managers).

FWIW, all users who successfully used the OpenGL painter (or Direct3D
for Windows users) on 0.24-fixes should go into Setup and change "Paint
engine" to use the "Auto" setting.  The only users who should ever use
anything else are those who have broken OpenGL implementations and
cannot or choose not to fix their systems.

Restores the ThemePainter setting (originally removed in fb45eb9fe) as:
-----
Paint engine
This selects what MythTV uses to draw. Choosing 'Auto' is recommended,
unless running on systems with broken OpenGL implementations (broken
hardware or drivers or windowing systems) where only Qt works.
-----

Apologies for the last-minute string addition.  Refs #10457.
Mention the detected character encoding

in log messages to make it easier to help debug issues.