[rbp/omxplayer] Merge with current dvdplayer

To make spotting differences between omxplayer and dvdplayer easier in the future,
this is a pretty slavish copy, including dvdplayer's whitespace and header file includes.
You now get a pretty clean diff between dvdplayer.cpp/dvdplayer.h and omxplayer.cpp/omxplayer.h
[rbp/omxplayer] Simplify clock handling

In OMXClock we have an almost complete copy of DVDClock, so just use DVDClock directly.

The passing through of CDVDClock functions from OMXClock is hopefully temporary,
as I think clock manipulation is better handled from OMXPlayer than audio/video players.
[rbp/omxplayer] Add plumbing for audio GetCacheTotal
[rbp/omxplayer] OMX spec says we can transition from execute to idle
[rbp/omxplayer] Workaround for audio_mixer is not required

We have similar code in command line omxplayer, and that has never had this
workaround. I've been running with it removed for some weeks with no problems.

I believe it was working around a bug elsewhere that is no longer present.
[rbp/omxplayer] Add calls for stepping and retreiving the clock adjustment
[rbp/omxplayer] Use OMXPlaySpeed for pause/resume
[rbp/omxplayer] dispmanx now handles negative rectangles correctly so adjustment not required
[rbp/omxplayer] Fix divide by zero at eof

If you leave the codec info up in a debug build and reach eof, you will abort.

This is due to audio decoder being closed, which zeros m_BytesPerSec, but the player info is still requested.
GetCacheTime will do a divide by zero. This change protects that divide.
[rbp/omxplayer] Remove flip timing logic from OMXPlayerVideo

Currently subs are ~500ms out of sync with a lot of jitter.

The video is not rendered by the arm, so a lot of the page flipping code is redundant.
Calling ProcessOverlays/FlipPage every frame is a big performance hit on Pi,
so I keep track of when the subs will next change and only call them then.

This has the side effect that ASS/SSA subs don't animate, so while sub is onscreen,
I periodically update (limited 10 fps).
[rbp/omxplayer] Remove discontinuity handling from players

I think sync/continuity checking done in OMXPlayerVideo and OMXPlayerAudio on Pi
is always wrong and leads to audio sync errors after discontinuities.

The GPU already does clock adjustment based on discontinuities in timestamps,
and is in a better position to do this adjustment.
(Remember there are a couple of seconds of buffered audio/video between here
and GPU and we want to adjust the clock at the other end of this queue).
[rbp/omxplayer] Fix for srt subtitle sync

Textual subs should be synchronised to the mediatime (OMXMediaTime) like graphical subs
[DVDDemux] Allow for larger difference in dts and pts of packet

If video does not start on an I frame, you can get a significant difference
in pts and dts values for the first frame. I've got two videos where they
differ by more than 0.1s.

In this case, we end up setting pts=0 and leaving dts alone (which may be minutes away).
This gets through to GPU on Pi, and it tends to stall waiting for this difference to elapse.

I'm not sure what the largest difference can be, but 0.5s feels completely safe.
I'm not sure of any problems increasing this will cause.
[rbp/omxplayer] do not reopen the resample context for each frame.

I think this doesn't tend to happen on Pi now, as AV_SAMPLE_FMT_S16 and AV_SAMPLE_FMT_FLTP bypass the resampler,
but best to fix it if some obscure codec returns something else.

See #2873
[rbp] Avoid overflow in version string

gedit complains about invalid characters when opening xbmc.log file produced by pi
Since the change from perforce revision number to git hash, the version string has increased in size.

Fortunately we don't overrun the "response" buffer.
Unfortunately when buffer doesn't fit, it is not null terminated, so logging message pulls in garbage.

Version string looks like:
Jun 17 2013 20:49:11
Copyright (c) 2012 Broadcom
version d380dde43fe729f043befb5cf775f99e54586cde (clean) (release)

So, 80 characters is not enough (it is about 115 plus newlines).
160 seems more than enough, but truncate the string just in case.
[rbp/omxplayer] Update pts on resync message

This was remove in #2853 and is still required for avi streams with all frames having pts=DVD_NOPTS_VALUE
Improve resilience of volume change.

Building on the previous fix for the audio volume jumps experienced
when switching tracks, this adds a double check that the underlying audio
layer has actually set the volume to the new value. This may fail because
the COMXAudio object it not yet initialised.

If there is a failure, then the volume change is retried in the next
iteration of COMXPlayer::Process().
[rbp/omxplayer] Avoid resampling in audio_mixer

audio_mixer output defaults to 44.1kHz. Set it to output of audio_decode to avoid a resampling step
This restores the behaviour prior to #2801
Revert "[rbp] Always use the aspect ratio from file."

This reverts commit 7f5d3ede514f30552e42464c29227d570b38ed8a.
[rbp/omxplayer] Use aspect ratio from video decoder

We don't get a valid aspect ratio from tvheadend with mpeg2 files, but the decoder does know, so use that.
This also supports streams where aspect ratio changes (e.g. at commercials) (with firmware from 25 June or newer).