DeviceReadBuffer: Try to optimize some of the busy-waiting.

Wait for readThreshold or 20 milliseconds before returning to the stream
handler.

Move the throttling "sleep" from the stream handler into the DRB run loop.

Original patch by Rune Petersen.
Closes #11252
DeviceReadBuffer: Deal with device drivers which segment their internal buffers.

Some device drivers segment their buffers into pieces, and will return at
most one "piece" at a time.  For efficent processing, we may need to process
more than one "piece" during each loop.
ASIStreamHandler: Detect how many driver buffers are available, and attempt
to read 1/4 of them during each pass in DeviceReadBuffer.
Fix a misuse of MythTimer.

This was what forced the [94028580] workaround earlier this week.

Refs #11255.
Don't call positionMapTimer.elapsed() until timer is running.

We actually ignore the value returned until positionMapTimer.start() has
been called, so this won't cause any program misbehaviour. But we might
as well use the timer API as intended.
Improves MythTimer contstructor.

Many times a MythTimer is constructed and start() is called immediately afterward.
This adds a parameter to the constructor StartState, so instead of:
  MythTimer t;
  t.start();
  do_something();
  int e = t.elapsed();

you can write:
  MythTimer t(MythTimer::StartRunning);
  do_something();
  int e = t.elapsed();

This also reverts [9402858049], which made starting the timer running the default.
The bug requiring that hack was fixed in [926464a3f1].

This also allows you to define DEBUG_TIMER_API_USAGE and have MythTimer assert
that the timer is running when elapsed is called to catch timer API misuse.
Fix direct system calling when using log parameter propagation.

This fixes an issue when attempting to run MythSystem commands directly,
outside of a system shell, without any custom arguments, and selecting
to propagate logging arguments. The issue that occurs is that the
logging arguments are incorrectly added to the executable path, meaning
the command cannot be successfully run.
Migrate Screen Setup Wizard to external application.

This sidesteps the issue of trying to display the corner arrows outside
the current extents of the UI by starting up an entirely new instance
and forcing it to full screen. The arrows are additionally replaced by
the theme's preview image, to more clearly exhibit the final appearance.

There are some issues and potential usability concerns that still need
to be addressed.
* The preview image repositions, but does not properly scale.
* There may need to be indicators to show what corner is currently used.
* The network control interfaces are not available.

This changeset includes a revision bump, and will require any theme with
a custom appear-ui.xml to be updated.
Improve performance in the MythPlayer event loop.

Don't call GetCurrentFrameCount() until it's actually needed, to avoid
making a protocol request on every frame during playback of live TV or
in-progress recordings.
Clean up the recording dialogs in ScheduleCommon.

Merge SC::ShowRecordingDialog(), SC::ShowNotRecordingDialog() and
SC::ShowNotScheduledDialog() into SC::EditRecording().  This does make
for a long function, but I find it much simpler to follow with all of
the logic concentrated in one place instead of spread over three.  It
removes a little duplicated code, too.  Also fix some inconsistencies
in the recording status textual descriptions.
Revert "Resolve MPEGStreamData::Reset() ambiguities."

This reverts commit [e75fb21c45942ee8a17a8d5c64901f2868658440].

This is causing tuning to fail some of the time.

What appears to happen is that MPEGStreamData::SetDesiredProgram()
calls ResetMPEG() when a program number is desired which has not
been seen yet. This cause the ATSC tuning data to also be reset,
which wasn't the case before [e75fb21c45] because of a bug in the
implementation, and this causes tuning to fail.

Refs #11334.
Don't call _cycle_timer.elapsed() unless timer is running.

We're depending on the value returned being 0 until the timer is
started. This code will work as intended, but it makes debugging
places where elapsed() is unintentionally called before start()
more difficult so I've added and isRunning() call.
Updated Russian MythFrontend, MythGallery, MythGame, MythMusic, MythNews and
MythWeather translation

Spasibo Alex!

Closes #11385

Signed-off-by: Nicolas Riendeau <nriendeau@mythtv.org>
Fix several cppcheck warnings.
Change VideoBuffers method names to StudlyCaps style.
Use recording rule priority as the primary scheduling priority.

Previously, priorities like input and channel were added to the
recording rule priority to calculate a single priority used in
scheduling.  Now, the recording rule priority is used by itself as the
primary priority.  The other priorities are summed together and used
as a secondary priority.

What this means is all programs matching a given recording rule,
including those on less desirable inputs and channels, are scheduled
before any programs matching lower priority rules.  This is more in
line with the way most users assume and expect the scheduler to work
and still allows the ancillary priorities to influence the scheduling
of specific showings.

Note: this is essentially a reintroduction of the "ComplexPriority"
scheme.
Update the ABI version for SHA1:5587501e.
Hopefully fix a rare segfault in MythUITextEdit when using mythmusic. I'm guessing but by no means certain that a linked copy of the string was altered in another thread, e.g. the metadata or playlist load thread. QString uses shallow copies and isn't threadsafe. detaching the string may use more memory but that's preferable to crashing.
Remove theme references to the defunct Set Recording Priorities screen.

This should have been done in SHA1:f8cb433b .
Enable more ffmpeg logging at startup of playback.

Allow logging in avformat_find_stream_info() if
"-v libav --loglevel debug" is specified.
This proves useful for live TV debugging among others.