220-handle_slow_server_stream_startup.patch 523 B

12345678910111213141516
  1. --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
  2. +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
  3. @@ -465,6 +465,13 @@ ffmpeg_probe(Decoder *decoder, InputStre
  4. unsigned char buffer[BUFFER_SIZE];
  5. size_t nbytes = decoder_read(decoder, is, buffer, BUFFER_SIZE);
  6. +
  7. + if ((nbytes > 0) && (nbytes < 1024))
  8. + {
  9. + // Gobble some more data if header is small
  10. + nbytes += decoder_read(decoder, is, buffer + nbytes, BUFFER_SIZE - nbytes);
  11. + }
  12. +
  13. if (nbytes <= PADDING || !is.LockRewind(IgnoreError()))
  14. return nullptr;