Fix random SBE PlaybackSock timeout in MBE.

SBE PlaybackSocks in the master suffer from random disconnection, occuring
after a 7000 ms timeout. It often happens when a frontend ask for the
thumbnail of a program currently being recorded on a slave backend.

I could identify two problems causing this:

First, there is a race between MainServer::ProcessRequestWork and
PlaybackSock::SendReceiveStringList. Even if callbacks are disabled during
SendReceiveStringList execution, a ProcessRequestWork may already be running
and can swallow the reply, leading to the timeout in SendReceiveStringList.

The second problem is that an invocation of ProcessRequestWork is fired for
each block of data arriving in the socket (for example when a reply is long
enough to be fragmented, ie. GENERATED_PIXMAP) but this data is consumed all at
once by one worker, leaving the other workers without food. This also leads to
the timeout in ReadStringList.

This patch fixes the first problem by assuring that no worker reads from the
socket while a SendReceiveStringList is running and the second one by aborting
a worker if there is no more data to read, but only once the lock has been
acquired.

Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
Revert "Fix random SBE PlaybackSock timeout in MBE."

Incorrect author name

This reverts commit d7eb6bddc2061287d15bade8d275f9422362f969.
Fix random SBE PlaybackSock timeout in MBE.

SBE PlaybackSocks in the master suffer from random disconnection, occuring
after a 7000 ms timeout. It often happens when a frontend ask for the
thumbnail of a program currently being recorded on a slave backend.

I could identify two problems causing this:

First, there is a race between MainServer::ProcessRequestWork and
PlaybackSock::SendReceiveStringList. Even if callbacks are disabled during
SendReceiveStringList execution, a ProcessRequestWork may already be running
and can swallow the reply, leading to the timeout in SendReceiveStringList.

The second problem is that an invocation of ProcessRequestWork is fired for
each block of data arriving in the socket (for example when a reply is long
enough to be fragmented, ie. GENERATED_PIXMAP) but this data is consumed all at
once by one worker, leaving the other workers without food. This also leads to
the timeout in ReadStringList.

This patch fixes the first problem by assuring that no worker reads from the
socket while a SendReceiveStringList is running and the second one by aborting
a worker if there is no more data to read, but only once the lock has been
acquired.

Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
Reduce CPU usage while waiting for seek to complete
Allows RemoteFile to recover from connection drop or timeout

From time to time, for some users reading from the controlSocket times out, which cause the connection to be dropped. This change allows to recover from this situation

Ref #12113
Reset failures count once a read succeed

The failure counter was for the entire playback’s duration. So should more than 5 read failures occurred, regardless of time, playback would have been interrupted.
As soon as a read succeed, reset the failure count to 0.

Ref #12113
Have RemoteFile attempt to fully reconnect in case of errors
Prevent crash should playback fail after ringbuffer has been destroyed
Don’t prevent read should we reached EOF or an error

Prevented to play the last few seconds of a recording.
Pause playback rather than exiting should backend stop responding or is stopped.

This allow to resume playback right after the backend is restarted.
there’s still an issue if you attempt to seek within the file while the backend is stopped. It will cause FFmpeg to reset the buffer and cause an eof situation, which isn’t recoverable.
MythFrontend: Make Xlib calls thread-safe on Linux

This seems to be required for hardware accelerated Flash playback to work
without causing mythfrontend to abort.
add unit test for comparing programs
more tests for movie equivalence
Fix probable cut-n-paste error.  VB_PLAYBACK should be VB_CHANNEL.
change default duplicate detection method to subtitle then description

Change default duplicate detection method from subtitle and description
to subtitle then description as discussed at
http://irc.mythtv.org/ircLog/channel/4/2014-05-02:15:03:54/2014-05-02:15:39:58
remove duplicate initialization of m_use_rtp_streaming
Create an 'active' filters buttonlist which can be used for informational
purposes in the schedule editor.

Allow the filters buttonlist to be used on the main schedule editor view.
Remove some unused key bindings.
Fix stuttery playback for FFmpeg's directly rendered frames

This occurs for mjpeg and 9/10 bits videos

Fix submitted by slackerlinux85@gmail.com. Thank you !

Fixes #10942
Fix playback of 9/10bit h264 videos

The fashion this fix is implemented is a hack more than anything else.
It disable the following H264 profile to be decoded via the GPU:
FF_PROFILE_H264_HIGH_10
FF_PROFILE_H264_HIGH_10_INTRA
FF_PROFILE_H264_HIGH_422
FF_PROFILE_H264_HIGH_422_INTRA
FF_PROFILE_H264_HIGH_444_PREDICTIVE
FF_PROFILE_H264_HIGH_444_INTRA
FF_PROFILE_H264_CAVLC_444

regardless of the GPU acceleration method (VDPAU, VAAPI, VDA, DXVA or CrystalHD). Which at this present time is acceptable enough as no hardware handle those profiles.

A proper implementation, per decoder, would require significant changes and code cleanup to the mess that is currently avformatdecoder.cpp

Fixes #10706