From 55eab1733b9e730ceac33edce9aab56c17ea87b2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 9 Mar 2017 15:43:30 +0100 Subject: [PATCH] ffmpeg, ffprobe: don't "merge" side data into packet data by default Preparation for potentially disabling merged side data by default in the libs. Do this in particular because it affects fate tests. The changed tests either reflect added packet side data, or the changed packet size due to merged side data removal reducing the packet size. --- ffmpeg_opt.c | 2 + ffprobe.c | 8 +++ libavformat/tests/seek.c | 2 + tests/ref/fate/gaplessenc-itunes-to-ipod-aac | 4 +- tests/ref/fate/gaplessenc-pcm-to-mov-aac | 4 +- tests/ref/fate/gaplessinfo-itunes1 | 4 +- tests/ref/fate/gaplessinfo-itunes2 | 4 +- tests/ref/fate/mov-aac-2048-priming | 3 +- tests/ref/seek/cache-pipe | 10 ++-- tests/ref/seek/extra-mp3 | 18 +++---- tests/ref/seek/lavf-ts | 54 ++++++++++---------- tests/ref/seek/mkv-codec-delay | 14 ++--- 12 files changed, 70 insertions(+), 57 deletions(-) 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