Fix playback of a final cut region.

Regression introduced in 49dbed5be0729b04a5f0fd0426a32fceb2dd7935.
Fix the duration map for back-to-back recordings.

durationMap, durationMapDelta, and _total_duration need to be reset
before starting a new back-to-back recording.  Thanks to Daniel K. for
spotting this.
Play closer to the end of the video.

Refs #6974.  When the end of the recording is reached, don't exit the
player immediately.  Instead, pause playback and let exiting be
handled by either the end-of-playback timer event or the
end-of-recording-delete-prompt timer event.  This removes IsNearEnd()
from end-of-playback consideration, as well as the randomness of where
in the 250ms window the timer events fire.

IsNearEnd() is still used in other places (e.g. to control playback
speed and bookmarking behavior near the end of a recording).  The
IsNearEnd() calculation is changed to depend on the number of frames
played by the player rather than the number of frames read by the
decoder thread, making IsNearEnd() more predictable and reliable.

Note that this does not address the original issue in #6974, which
involves allowing the accumulated decoded frames to be displayed after
the decoder reaches EOF.
Enable 'best match' detection for recording metadata lookups.

This enables the automatic mode which attempts to identify the correct
match when multiple results are returned. This is already used for
videos but was for some reason disabled for recordings.

This may result in incorrect metadata for some recordings and we'll
try to fix that as best we can, but it should generally behave better
than before where a high percentage of lookups resulted in no artwork
at all because most lookups matching multiple results resulted in failure.
Optimise findBestMatch() so that an exact title match is found we avoid an expensive title comparison search
Fix end-of-playback logic for in-progress recordings.

The bug was introduced in 91ec76e8afba1833a7cb64f17429910f29b39404 and
found by Stuart M.
Reset the decoder EOF state before seeking.

This can be necessary if the cutlist editor tries to seek beyond the
last frame the decoder knows about, in which case the decoder gets
stuck thinking it has reached EOF and seeking stops working correctly.
Cleanup trailing whitespace in recorders directory
Fixes #6974.  Play all the way to the end of the video.

Playback is allowed to continue even after the decoder thread reaches
the EOF state, until decoded and buffered frames are drained from the
decoder.  This may represent anywhere from 0.25s to 1s of content.

Thanks to Mark Spieth for providing and maintaining the patch.
Fix display of current position for DVD playback.

Regression introduced in 49dbed5be0729b04a5f0fd0426a32fceb2dd7935.
Fix EOF detection/handling for DVD titles.

Separate the EOF logic for DVDs and videos/recordings.  DVDs need not
be concerned with DeleteMaps, and videos/recordings need not be
concerned with DVD menus and still frames.
Fix "mythcommflag --rebuild" for non-HDPVR recordings.

By default, only identify IDR keyframes for h.264 recordings.
However, since DVB-S recordings may lack IDR frames, we check after
500 frames whether any keyframes have been found, and if not, back up
and restart using the more lenient setting.
Merge remote-tracking branch 'upstream/master'