Add FFmpeg fake header/header_size check to simplify some calls

This commit is contained in:
bnnm 2018-03-31 13:07:26 +02:00
parent 0e64480cd0
commit 7a08ea263f

View File

@ -364,6 +364,10 @@ ffmpeg_codec_data * init_ffmpeg_config(STREAMFILE *streamFile, uint8_t * header,
memcpy(&data->config, config, sizeof(ffmpeg_custom_config));
}
/* ignore bad combos */
if ((header && !header_size) || (!header && header_size))
goto fail;
/* fake header to trick FFmpeg into demuxing/decoding the stream */
if (header_size > 0) {
data->header_size = header_size;