diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index e2c0176e14..fc885dfac3 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -927,6 +927,7 @@ static int open_input_file(OptionsContext *o, const char *filename) print_error(filename, AVERROR(ENOMEM)); exit_program(1); } + ic->flags |= AVFMT_FLAG_KEEP_SIDE_DATA; if (o->nb_audio_sample_rate) { av_dict_set_int(&o->g->format_opts, "sample_rate", o->audio_sample_rate[o->nb_audio_sample_rate - 1].u.i, 0); } @@ -1912,6 +1913,7 @@ static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const ch int i, err; AVFormatContext *ic = avformat_alloc_context(); + ic->flags |= AVFMT_FLAG_KEEP_SIDE_DATA; ic->interrupt_callback = int_cb; err = avformat_open_input(&ic, filename, NULL, NULL); if (err < 0) diff --git a/ffprobe.c b/ffprobe.c index b104390990..17dc73294f 100644 --- a/ffprobe.c +++ b/ffprobe.c @@ -2575,6 +2575,14 @@ static int open_input_file(InputFile *ifile, const char *filename) AVDictionary **opts; int scan_all_pmts_set = 0; + fmt_ctx = avformat_alloc_context(); + if (!fmt_ctx) { + print_error(filename, AVERROR(ENOMEM)); + exit_program(1); + } + + fmt_ctx->flags |= AVFMT_FLAG_KEEP_SIDE_DATA; + if (!av_dict_get(format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) { av_dict_set(&format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE); scan_all_pmts_set = 1; diff --git a/libavformat/tests/seek.c b/libavformat/tests/seek.c index 7ed56ba4ef..5cf3a123e3 100644 --- a/libavformat/tests/seek.c +++ b/libavformat/tests/seek.c @@ -67,6 +67,8 @@ int main(int argc, char **argv) int frame_count = 1; int duration = 4; + ic->flags |= AVFMT_FLAG_KEEP_SIDE_DATA; + for(i=2; i