Fix crash.

When playback request failed for whatever reason, if we were to check for the playback status it would crash due to ic being NULL.
(cherry picked from commit cc1ca2ef2c12cd25cbced5b57b527382d2d70926)
Properly handle multi-part http request in AirPlay video

This commit also adds the basics required to support AirPlay photo. Incidentally, properly handling multi-part data now allows to play videos from the iPhone "Photos" app.
(cherry picked from commit 75541357af4a527057301f8f1b4b2ae0368f47b1)
changed: allow 4 second skew between streams in mov before attempting to seek

Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
(cherry picked from commit e4170c604e6a6af969e5de74ac740ac596686da8)
Apply patch from XBMC by Joakim Plate: "changed: allow 4 second skew between streams in mov before attempting to seek"
(cherry picked from commit d0ea1417db42debc12e56030581e573151960538)

Conflicts:
	mythtv/external/FFmpeg/README.sync
Rewrite of StreamingRingBuffer::safe_read

safe_read was based on FFmpeg's ffurl_read_complete, however when an EOF or an error is encountered, ffurl_read_complete returns the error code rather than the number of bytes read so far.
Rather than wait for FFmpeg to fix it (ref: https://ffmpeg.org/trac/ffmpeg/ticket/2537) ; work around it.
safe_read now will set errno as expected and always return a value >= 0 representing the number of bytes actually read.

Fixes #11263
(cherry picked from commit 8b8ec72b005ecf1cb9d36bb4f82469b3718fefb4)
Ignore network error on an interface that no longer exists.

Under some circumstances, a network interface can disappear during the lifetime of the process. Simply ignore those rather than failing the whole process (by default, networking operations must work on all interfaces found)
(cherry picked from commit fd44e2fcbbc4c3dc6fe835c1d62686fafe3b2833)
If AV codec context doesn't match the context for which it was first opened, close/re-open it.

There's something suspiciously wrong about the way we handle change of streams. This is at best a work-around.

Fixes #11519
(cherry picked from commit 40db16fc3b486042469df8e84290e5d42fc6036f)
Rework RAOP audio sync

commit 9ec7421138adef73ef9cb83b74e046092fecdd6a that fixed audio timestamp calculations revealed an issue in the way RAOP was calculating and setting time syncing.
Rework how things are done: We now calculate the audio card latency and simply drop the initial audio frames amounting for such length of time. From that point on, when we get too far behind we drop all queued audio and restart.

Rather than dropping a whole audio packet at a time (352 frames) we now drop frame by frame, so re-syncs are much smoother.

Surprisingly, this simpler method gives much better results. Synchronisation across multiple airplay device is almost perfect (tested across 2 macs and one linux). Remote audio and video sync are spot on.

Fixes #11530
(cherry picked from commit 96f58cbf4baa16b2008888f92d4ce2fb7e615aec)
Fix possible segfault when exiting a screen when using the Qt painter

This changes MythScreenStack::PopScreen() to call deleteLater() on the
screen rather than immediately deleting it so as to allow any keypressEvent
handlers to complete safely before the screen is deleted when control
returns to the event loop.

Fixes #11383.
(cherry picked from commit c713988707d2c795a2a2abeff817d1b187d4b3f6)
Fix bug in mythtranscodes clean-cutting mechanism

One of the clean-cut methods interacted badly with mythtranscodes
synchronisation algorithm and would sometimes cause frames from
cut segments to be kept. This commit fixes that bug

Refs #11531