pvr: fix deadlock caused by pollling channel group name
Added SFTP to the check for internet streams as a "special case" (similar to ftp/ftps)
Merge pull request #5278 from arucard21/SFTP_as_internetstream
Merge pull request #5269 from FernetMenta/pvr

pvr: fix deadlock caused by pollling channel group name
[omxplayer] Merge in latest dvdplayer changes
[dvdplayer] Make players pointers rather than objects
[dvdplayer] Create a base class for audio and video players
[dvdplayer] Add dummy hooks in useful places
[omxplayer] Rework trickplay to reduce changes to dvdplayer
[omxplayer] Make omxplayer use dvdplayer as base class
[omxplayer] Allow choice of omxplayer through acceleration settings
[players] Remove omxplayer as separately selectable player
omxplayer: Reset codec on flush to stop a stale timestamp from being returned
[omxplayer] Don't flush queued data on general reset

We were flushing the queue of data to gpu (which can be a number of seconds worth) on a general reset.
However this is generated on inoccuous events like a chapter change in dvd playback.

This results in a few seconds loss of audio, and a temporary audio/video sync error
[dvdplayer] Allow UpdateCorrection to handle audio and video jumping asynchronously

This is sequence of timestamps (before correction) from The Grand Budapest Host chapter 3.

12:07:04 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:0 dts:  95502.94 pts:  95502.94 correction:      0.00 size:   46475
12:07:04 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:  95502.80 pts:  95502.80 correction:      0.00 size:    1792
12:07:04 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:0 dts:  95502.98 pts:  95502.98 correction:      0.00 size:   47057
12:07:04 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.12 pts:     59.12 correction:      0.00 size:    1792
12:07:04 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.12 pts:     59.12 correction: -95443.72 size:    1792
12:07:04 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:0 dts:  95503.03 pts:      0.00 correction: -95443.72 size:   60924
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.15 pts:     59.15 correction: -95443.72 size:    1792
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.18 pts:     59.18 correction: -95443.72 size:    1792
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:0 dts:  95503.08 pts:  95503.08 correction: -95443.72 size:   46031
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.21 pts:     59.21 correction: -95443.72 size:    1792
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:0 dts:  95503.11 pts:  95503.11 correction: -95443.72 size:   43036
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.25 pts:     59.25 correction: -95443.72 size:    1792
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:0 dts:  95503.14 pts:      0.00 correction: -95443.72 size:   59193
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.28 pts:     59.28 correction: -95443.72 size:    1792
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.31 pts:     59.31 correction: -95443.72 size:    1792
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:2 dts:     59.49 pts:     59.49 correction: -95443.72 size:    4868
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.34 pts:     59.34 correction: -95443.72 size:    1792
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.37 pts:     59.37 correction: -95443.72 size:    1792
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:0 dts:  95503.19 pts:  95503.19 correction: -95443.72 size:   42475
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.41 pts:     59.41 correction: -95443.72 size:    1792
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:0 dts:     59.53 pts:     59.56 correction: -95443.72 size:   49850
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:0 dts:  95503.24 pts:  95503.28 correction: -95443.72 size:   49850
12:07:08 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.44 pts:     59.44 correction:-190887.44 size:    1792
12:07:13 T:2730484832   DEBUG: CDVDPlayer::UpdateCorrection - stream:1 dts:     59.47 pts:     59.47 correction:-190887.44 size:    1792

Note that audio and video jump at different times.

At the end of this correction should be -95443.72, but it actually jumps twice to double that.

The timestamps arriving at PlayerVideo are not continuous, but jump from 95443 to 190887.

This patch chooses to wait until audio and video have both jumped, and while only one has jumped, it gets timestamps of DVD_NOPTS_VALUE.

This fixes the problem on my dvd, and appears to also fix this issue:
http://forum.xbmc.org/showthread.php?tid=201944
[rbp] Hardware accelerated resampling

This replaces the format conversion, up/down mixing and resampling code from ActiveAE with a GPU accelerated version.
Should significantly reduce CPU when using paplayer or dvdplayer.

Requires updated firmware
[rbp/omxplayer] When opening a stream don't try to update gui so often
[ffmpeg] Speed up wtv index creation

The index creation is O(N^2) with number of entries (typically thousands).
On a Pi this can take more than 60 seconds to execute for a recording of a few hours.

By replacing with an O(N) loop, this takes virtually zero time
ffmpeg: Add armv6 acceleration for imdct/fft used by ac3/aac

armv6: Accelerate ff_imdct_half for general case (mdct_bits != 6)

The previous implementation targeted DTS Coherent Acoustics, which only
requires mdct_bits == 6. This relatively small size lent itself to
unrolling the loops a small number of times, and encoding offsets
calculated at assembly time within the load/store instructions of each
iteration.

In the more general case (codecs such as AAC and AC3) much larger arrays
are used - mdct_bits == [8, 9, 11]. The old method does not scale for
these cases, so more integer registers are used with non-unrolled versions
of the loops (and with some stack spillage). The postrotation filter loop
is still unrolled by a factor of 2 to permit the double-buffering of some
VFP registers to facilitate overlap of neighbouring iterations.

I benchmarked the result by measuring the number of gperftools samples
that hit anywhere in the AAC decoder (starting from aac_decode_frame())
or specifically in ff_imdct_half_c / ff_imdct_half_vfp, for the same
example AAC stream:

                  Before          After
                  Mean   StdDev   Mean   StdDev  Confidence  Change
aac_decode_frame  2368.1 35.8     2117.2 35.3    100.0%      +11.8%
ff_imdct_half_*   457.5  22.4     251.2  16.2    100.0%      +82.1%

armv6: Accelerate ff_fft_calc for general case (nbits != 4)

The previous implementation targeted DTS Coherent Acoustics, which only
requires nbits == 4 (fft16()). This case was (and still is) linked directly
rather than being indirected through ff_fft_calc_vfp(), but now the full
range from radix-4 up to radix-65536 is available. This benefits other codecs
such as AAC and AC3.

The implementaion is based upon the C version, with each routine larger than
radix-16 calling a hierarchy of smaller FFT functions, then performing a
post-processing pass. This pass benefits a lot from loop unrolling to
counter the long pipelines in the VFP. A relaxed calling standard also
reduces the overhead of the call hierarchy, and avoiding the excessive
inlining performed by GCC probably helps with I-cache utilisation too.

I benchmarked the result by measuring the number of gperftools samples that
hit anywhere in the AAC decoder (starting from aac_decode_frame()) or
specifically in the FFT routines (fft4() to fft512() and pass()) for the
same sample AAC stream:

              Before          After
              Mean   StdDev   Mean   StdDev  Confidence  Change
Audio decode  2245.5 53.1     1599.6 43.8    100.0%      +40.4%
FFT routines  940.6  22.0     348.1  20.8    100.0%      +170.2%
adds GetTvShowSeasons