flvdec: Do not default to a video and audio stream

If no streams were indicated in the FLV header, do not automatically
allocate by default a video and an audio stream. Instead, in the case
that the header did not indicate the presence of any data, allocate no
stream until data actually arrives for one type.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtmppkt: Add method to read an AMF string that is not prefixed by its type

Signed-off-by: Martin Storsjö <martin@martin.st>
rtmpproto: read metadata to set correct FLV header

In the presence of no metadata, do not set any stream flag in the FLV
header but let the demuxer handle the detection and creation of streams
as data arrives.

Signed-off-by: Martin Storsjö <martin@martin.st>
Merge commit 'a1859032e39d96352687186fd179e1559dea2aca'

* commit 'a1859032e39d96352687186fd179e1559dea2aca':
  flvdec: Do not default to a video and audio stream

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '3b18857ab301d2a0b3e86e9d85eed76f0798a29c'

* commit '3b18857ab301d2a0b3e86e9d85eed76f0798a29c':
  rtmppkt: Add method to read an AMF string that is not prefixed by its type

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '59cb5747ec3c5cd842b94e574c37889521c97cc4'

* commit '59cb5747ec3c5cd842b94e574c37889521c97cc4':
  rtmpproto: read metadata to set correct FLV header

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Rewrite main resampling loop (common and linear).

This removes a branch at a performance-sensitive point (in the middle
of the loop). In fate-swr-resample-s32p-8000-2626, this makes the code
about 10% faster. It also simplifies the loops, allowing us to rewrite
it in yasm at some later point.

The compensation_distance != 0 code and index < 0 code are still kind
of hairy. For compensation_distance != 0, this should likely be handled
in the caller, so that it calls swri_resample twice (once until the
dst_incr switch-point, and once with the remainder of the samples). For
index < 0, the code should probably be rewritten to break out of the
loop once sample_index >= 0, and then resume (e.g. as a tail-call) to
the common or linear resampling loops.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swr/resample_template: prevent end_index from overflowing and add check for delta_frac overflow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>