mlpdec: support major sync headers with optional extension blocks

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mlpdec: support TrueHD streams with an Atmos substream

The fourth substream is being discarded, since its not raw audio data,
but an encoded Atmos stream which needs a specialized decoder.

Fixes decoding of the true hd stream from Transformers\ -\ Age\ of\ Extinction\ 2014\ 1080P-003.mkv

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/mp3dec: avoid early EOF with concatenated gapless mp3s

Consider a file created with something like:

    cat file1.mp3 file2.mp3 > result.mp3

Then if file2.mp3 has gapless information, result.mp3 would stop playing
something in the middle. This happens because the gapless info directs
the decoder to discard all samples after a certain position. To make
matters worse, the gapless info of file2.mp3 will be used when playing
the file1.mp3 part, because the gapless info is located at the end of
the file.

While handling concatenated gapless files correctly would be insane and
a lot of effort (especially without scanning the whole file on opening),
it's easy to prevent at least early EOF. Playback will happen to work,
even if it's slightly broken.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
rtpdec_hevc: do not print an error message if the received packet has a valid header but lacks additional bytes as payload

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Support raw dvdsub palette as stored on normal dvd's

This is how the palette is stored on dvd's. Currently
only xbmc passes the palette information to libavcodec
this way.
Check return value of avio_seek and avoid modifying state if it fails

The code still modifies state if the timestamp is not found. Not
sure exactly how to avoid that.
asf hacks
if av_read_packet returns AVERROR_IO, we are done. ffmpeg's codecs might or might not handle returning any completed demuxed packets correctly
added: Ticket #7187, TV Teletext support for DVB EBU Teletext streams
Don't accept mpegts PMT that isn't current
Don't reparse PMT unless it's version has changed
Read PID timestamps as well as PCR timestamps to find location in mpegts stream
Get stream durations using read_timestamp
changed: allow 4 second skew between streams in mov before attempting to seek
fixed: memleak in mpegts demuxer on some malformed (??) mpegts files with too large pes packets

at-visions sample file brokenStream.mpg
Speed up mpegts av_find_stream_info
dxva-h264 Fix dxva playback of streams that don't start with an I-Frame.
add public version of ff_read_frame_flush

We need this since we sometimes seek on the
input stream behind ffmpeg's back. After this
all data need to be flushed completely.