macosx: implement libvlc exit handler to properly terminate the app when requested

This is the only supported way to terminate an cocoa application and also ensure
that the gui settings are getting saved. Adapted from similar code in the qt
module.
macosx: fix and cleanup quit-after-playback main menu item

close #6073
NSIS: use ifdiff and not ifnewer for file installation

This should allow downgrades.
Close #10551
httplive: use correct segment to calculate duration

Fixes off-by-one segment duration uses, and actually use
new segments length to see how long segments are and when
the playlist should be reloaded.
codec: jpeg encoder implemented

This patch implements jpeg encoder using libjpeg.

Signed-off-by: Rafaël Carré <funman@videolan.org>
codec: jpeg encoder: fix build for older libjpeg
wasapi: split as separate module
mmdevice: fix restart due to preemption in Start()
DirectSound: reorder to reduce forward declarations
DirectSound: remove stray event handle
DirectSound: factor out common code for legacy and MMDevice
DirectSound: add support for MMDevice API (fixes #7394)
MMDevice: only WASAPI lacks S/PDIF support so far (refs #6827)
contrib/avcodec: unconditionally enable pic on iOS (close #10532, close #10531)
iOS: don't deploy xcrun as for Intel builds as this isn't needed
vdpau/avcodec: update to libavcodec 55.26.0
Support hevc ts demultiplexing

Beware the ts with hevc muxed as private PES seem to have PCR issue and should be played in case of problem with --no-ts-trust-pcr to avoid drops.
codec: jpeg: Check for NULL p_pic before encoding
vdpau/avcodec: fix build for older ffmpeg
dcp: Use .pc files for asdcplib

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>